@@ -71,19 +71,22 @@ network_driver_t* current_network_driver;
7171static alp_init_args_t alp_init_args ;
7272
7373// Define the D7 interface configuration used for sending the ALP command on
74- static d7ap_session_config_t session_config = {
75- .qos = {
76- .qos_resp_mode = SESSION_RESP_MODE_ANY ,
77- .qos_retry_mode = SESSION_RETRY_MODE_NO
78- },
79- .dormant_timeout = 0 ,
80- .addressee = {
81- .ctrl = {
82- .nls_method = AES_NONE ,
83- .id_type = ID_TYPE_NOID ,
74+ static alp_interface_config_t itf_cfg = {
75+ .itf_id = ALP_ITF_ID_D7ASP ,
76+ .d7ap_session_config = {
77+ .qos = {
78+ .qos_resp_mode = SESSION_RESP_MODE_ANY ,
79+ .qos_retry_mode = SESSION_RETRY_MODE_NO
8480 },
85- .access_class = 0x01 ,
86- .id = 0
81+ .dormant_timeout = 0 ,
82+ .addressee = {
83+ .ctrl = {
84+ .nls_method = AES_NONE ,
85+ .id_type = ID_TYPE_NOID ,
86+ },
87+ .access_class = 0x01 ,
88+ .id = 0
89+ }
8790 }
8891};
8992
@@ -99,13 +102,21 @@ void on_alp_command_completed_cb(uint8_t tag_id, bool success) {
99102 log_print_string ("Command failed, no ack received" );
100103}
101104
102- void on_alp_command_result_cb (d7ap_session_result_t result , uint8_t * payload , uint8_t payload_length ) {
103- log_print_string ("recv response @ %i dB link budget from:" , result .link_budget );
104- log_print_data (result .addressee .id , 8 );
105+ void on_alp_command_result_cb (alp_interface_status_t * result , uint8_t * payload , uint8_t payload_length ) {
106+ if (result -> itf_id == ALP_ITF_ID_D7ASP ) {
107+ d7ap_session_result_t d7_result ;
108+ memcpy (& d7_result , result -> itf_status , result -> len );
109+ log_print_string ("recv response @ %i dB link budget from:" , d7_result .link_budget );
110+ log_print_data (d7_result .addressee .id , 8 );
111+ }
112+
113+ log_print_string ("response payload:" );
114+ log_print_data (payload , payload_length );
115+
105116}
106117
107118static uint8_t transmit_d7ap (uint8_t * alp , uint16_t len ) {
108- alp_layer_execute_command_over_d7a (alp , len , & session_config );
119+ alp_layer_execute_command_over_itf (alp , len , & itf_cfg );
109120 return 0 ;
110121}
111122
0 commit comments