User Messaging (user)#

This class provides one command and one event which can be used by a NCP host and target to implement a communication mechanism with a custom proprietary protocol. An application must decide whether and how the command and event are used. The stack does not produce or consume any messages belonging to this class.

user commands#

user_message_to_target#

Used by an NCP host to send a message to the target application on device. The application on target is must send the response with gecko_send_rsp_user_message_to_target.

C API#

/* Function */  
struct gecko_msg_user_message_to_target_rsp_t *gecko_cmd_user_message_to_target(uint8 data_len, const uint8 *data_data);  
  
/* Response id */  
gecko_rsp_user_message_to_target_id  
  
/* Response structure */  
struct gecko_msg_user_message_to_target_rsp_t  
{  
  uint16 result;  
  uint8array data;  
}  

Command Parameters (for BGAPI headers refer to link)#

Type

Name

Description

uint8

data_len

Array length.

uint8array

data_data

The message

Response Parameters (for BGAPI headers refer to link)#

Type

Name

Description

uint16

result

Result code

  • 0: success

  • Non-zero: an error has occurred

For other values see Error codes
uint8array | data | The response message

user events#

user_message_to_host#

Used by the target application on a device to initiate communication and send a message to the NCP host. Do not send event messages in the context of the user command handling.

C API#

/* event id*/  
gecko_evt_user_message_to_host_id  
  
/* event structure*/  
struct gecko_msg_user_message_to_host_evt_t  
{  
  uint8array data;  
}  

Event Parameters (for BGAPI headers refer to link)#

Type

Name

Description

uint8array

data

The message