@@ -36,7 +36,7 @@ typedef struct uri_registration {
3636typedef NS_LIST_HEAD (uri_registration_t , link ) uri_registration_list_t ;
3737
3838typedef struct coap_service {
39- coap_service_security_done_cb * security_done_cb ;
39+ coap_service_security_done_cb * coap_security_done_cb ;
4040 coap_service_security_start_cb * security_start_cb ;
4141 coap_service_virtual_socket_send_cb * virtual_socket_send_cb ;
4242 uri_registration_list_t uri_list ;
@@ -244,8 +244,8 @@ static void sec_done_cb(int8_t socket_id, uint8_t address[static 16], uint16_t p
244244{
245245 //TODO: this is not enough if shared socket. Inform all!
246246 coap_service_t * this = service_find_by_socket (socket_id );
247- if (this && this -> security_done_cb ) { // secure done callback
248- this -> security_done_cb (this -> service_id , address , keyblock );
247+ if (this && this -> coap_security_done_cb ) { // secure done callback
248+ this -> coap_security_done_cb (this -> service_id , address , keyblock );
249249 }
250250
251251 //TODO refactor this away. There should be no transaction_ptr(s) before done_cb has been called
@@ -276,7 +276,7 @@ static int get_passwd_cb(int8_t socket_id, uint8_t address[static 16], uint16_t
276276}
277277
278278int8_t coap_service_initialize (int8_t interface_id , uint16_t listen_port , uint8_t service_options ,
279- coap_service_security_start_cb * start_ptr , coap_service_security_done_cb * security_done_cb )
279+ coap_service_security_start_cb * start_ptr , coap_service_security_done_cb * coap_security_done_cb )
280280{
281281 (void ) interface_id ;
282282
@@ -295,7 +295,7 @@ int8_t coap_service_initialize(int8_t interface_id, uint16_t listen_port, uint8_
295295 this -> service_options = service_options ;
296296
297297 this -> security_start_cb = start_ptr ;
298- this -> security_done_cb = security_done_cb ;
298+ this -> coap_security_done_cb = coap_security_done_cb ;
299299
300300 if (tasklet_id == -1 ) {
301301 tr_debug ("service tasklet init" );
@@ -447,13 +447,13 @@ int8_t coap_service_unregister_uri(int8_t service_id, const char *uri)
447447}
448448
449449uint16_t coap_service_request_send (int8_t service_id , uint8_t options , const uint8_t destination_addr [static 16 ], uint16_t destination_port , sn_coap_msg_type_e msg_type , sn_coap_msg_code_e msg_code , const char * uri ,
450- uint8_t cont_type , const uint8_t * payload_ptr , uint16_t payload_len , coap_service_response_recv * request_response_cb ){
450+ sn_coap_content_format_e cont_type , const uint8_t * payload_ptr , uint16_t payload_len , coap_service_response_recv * request_response_cb ){
451451 //TODO: coap_service_response_recv is an ugly cast, this should be refactored away + sn_coap_hdr_s MUST NOT be exposed to users of coap-service!
452452 //Callback would be still needed, but where to store callback?
453453 return coap_message_handler_request_send (coap_service_handle , service_id , options , destination_addr , destination_port , msg_type , msg_code , uri , cont_type , payload_ptr , payload_len , request_response_cb );
454454}
455455
456- int8_t coap_service_response_send (int8_t service_id , uint8_t options , sn_coap_hdr_s * request_ptr , sn_coap_msg_code_e message_code , int32_t content_type , const uint8_t * payload_ptr ,uint16_t payload_len ){
456+ int8_t coap_service_response_send (int8_t service_id , uint8_t options , sn_coap_hdr_s * request_ptr , sn_coap_msg_code_e message_code , sn_coap_content_format_e content_type , const uint8_t * payload_ptr ,uint16_t payload_len ){
457457 return coap_message_handler_response_send (coap_service_handle , service_id , options , request_ptr , message_code , content_type , payload_ptr , payload_len );
458458}
459459
0 commit comments