@@ -239,6 +239,7 @@ static void ocpp_internal_handler(void *p1, void *p2, void *p3)
239
239
break ;
240
240
241
241
case PDU_METER_VALUES :
242
+ {
242
243
union ocpp_io_value io ;
243
244
sys_snode_t * node ;
244
245
struct ocpp_session * lsh ;
@@ -270,7 +271,7 @@ static void ocpp_internal_handler(void *p1, void *p2, void *p3)
270
271
}
271
272
k_mutex_unlock (& ctx -> ilock );
272
273
break ;
273
-
274
+ }
274
275
case PDU_HEARTBEAT :
275
276
ocpp_heartbeat (sh );
276
277
/* adjust local time with cs time ! */
@@ -286,18 +287,15 @@ static void ocpp_internal_handler(void *p1, void *p2, void *p3)
286
287
break ;
287
288
288
289
case PDU_REMOTE_START_TRANSACTION :
289
- msg .msgtype = OCPP_USR_START_CHARGING ;
290
- ctx -> cb (msg .msgtype , & msg .usr , ctx -> user_data );
290
+ ctx -> cb (OCPP_USR_START_CHARGING , & msg .usr , ctx -> user_data );
291
291
break ;
292
292
293
293
case PDU_REMOTE_STOP_TRANSACTION :
294
- msg .msgtype = OCPP_USR_STOP_CHARGING ;
295
- ctx -> cb (msg .msgtype , & msg .usr , ctx -> user_data );
294
+ ctx -> cb (OCPP_USR_STOP_CHARGING , & msg .usr , ctx -> user_data );
296
295
break ;
297
296
298
297
case PDU_UNLOCK_CONNECTOR :
299
- msg .msgtype = OCPP_USR_UNLOCK_CONNECTOR ;
300
- ctx -> cb (msg .msgtype , & msg .usr , ctx -> user_data );
298
+ ctx -> cb (OCPP_USR_UNLOCK_CONNECTOR , & msg .usr , ctx -> user_data );
301
299
break ;
302
300
303
301
default :
@@ -345,6 +343,7 @@ static int ocpp_process_server_msg(struct ocpp_info *ctx)
345
343
char skey [CISTR50 ];
346
344
347
345
case PDU_BOOTNOTIFICATION :
346
+ {
348
347
struct boot_notif binfo ;
349
348
350
349
ret = fn (ui -> recv_buf , & binfo );
@@ -353,9 +352,10 @@ static int ocpp_process_server_msg(struct ocpp_info *ctx)
353
352
ctx -> hb_sec = binfo .interval ;
354
353
}
355
354
break ;
356
-
355
+ }
357
356
case PDU_AUTHORIZE :
358
357
case PDU_STOP_TRANSACTION :
358
+ {
359
359
struct ocpp_idtag_info idinfo = {0 };
360
360
361
361
if (sh == NULL ) {
@@ -367,8 +367,10 @@ static int ocpp_process_server_msg(struct ocpp_info *ctx)
367
367
sh -> resp_status = idinfo .auth_status ;
368
368
}
369
369
break ;
370
-
370
+ }
371
371
case PDU_START_TRANSACTION :
372
+ {
373
+ struct ocpp_idtag_info idinfo = {0 };
372
374
if (sh == NULL ) {
373
375
break ;
374
376
}
@@ -379,7 +381,7 @@ static int ocpp_process_server_msg(struct ocpp_info *ctx)
379
381
sh -> resp_status = idinfo .auth_status ;
380
382
}
381
383
break ;
382
-
384
+ }
383
385
case PDU_GET_CONFIGURATION :
384
386
memset (skey , 0 , sizeof (skey ));
385
387
@@ -402,6 +404,7 @@ static int ocpp_process_server_msg(struct ocpp_info *ctx)
402
404
break ;
403
405
404
406
case PDU_CHANGE_CONFIGURATION :
407
+ {
405
408
char sval [CISTR500 ] = {0 };
406
409
407
410
memset (skey , 0 , sizeof (skey ));
@@ -412,7 +415,7 @@ static int ocpp_process_server_msg(struct ocpp_info *ctx)
412
415
413
416
ocpp_change_configuration (skey , ctx , sval , uid );
414
417
break ;
415
-
418
+ }
416
419
case PDU_HEARTBEAT :
417
420
/* todo : sync time */
418
421
break ;
@@ -471,7 +474,7 @@ static void ocpp_wsreader(void *p1, void *p2, void *p3)
471
474
struct ocpp_info * ctx = p1 ;
472
475
struct ocpp_upstream_info * ui = & ctx -> ui ;
473
476
struct zsock_pollfd tcpfd ;
474
- uint8_t ret ;
477
+ int ret ;
475
478
uint8_t retry_cnt = 0 ;
476
479
477
480
ctx -> is_cs_offline = true;
0 commit comments