Save IVIM_t struct upon new IVIM

This commit is contained in:
emanuel 2021-06-22 14:02:08 +01:00
parent 1a44f6040c
commit 1a76fd89cb
2 changed files with 2 additions and 1 deletions

View File

@ -331,6 +331,7 @@ static int service_add(infrastructure_t* infrastructure, enum SERVICE_TYPE type,
} }
if (index != -1) { if (index != -1) {
infrastructure->services[index]->ivim = ivim;
infrastructure->services[index]->id = rand(); infrastructure->services[index]->id = rand();
*id = infrastructure->services[index]->id; *id = infrastructure->services[index]->id;
infrastructure->services[index]->enabled = true; infrastructure->services[index]->enabled = true;

View File

@ -343,7 +343,7 @@ int facilities_request_active_events(facilities_t* facilities, void* responder,
fdres->result->choice.events.list.size = nae * sizeof(DENM_t *); fdres->result->choice.events.list.size = nae * sizeof(DENM_t *);
fdres->result->choice.events.list.array = malloc(nae * sizeof(DENM_t *)); fdres->result->choice.events.list.array = malloc(nae * sizeof(DENM_t *));
for (int i = 0, j = 0; j < nae; ++i) { for (int i = 0, j = 0; j < nae; ++i) {
if (facilities->den->events[i]->state == EVENT_ACTIVE) { if (facilities->den->events[i]->enabled && facilities->den->events[i]->state == EVENT_ACTIVE) {
fdres->result->choice.events.list.array[j] = calloc(1, sizeof(ItsMessage_t)); fdres->result->choice.events.list.array[j] = calloc(1, sizeof(ItsMessage_t));
fdres->result->choice.events.list.array[j]->itsMessageType = ItsMessageType_denm; fdres->result->choice.events.list.array[j]->itsMessageType = ItsMessageType_denm;
fdres->result->choice.events.list.array[j]->data.buf = malloc(2048); fdres->result->choice.events.list.array[j]->data.buf = malloc(2048);