User messaging (user)#

This class provides one command and one event which can be utilized by a NCP host and target to implement a communication mechanism with own proprietary protocol. An application has the full responsibility on deciding 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#

This command can be used by an NCP host to send a message to the target application on device.

Command#

Byte

Type

Name

Description

0

0x20

hilen

Message type: Command

1

0x01

lolen

Minimum payload length

2

0xff

class

Message class:User messaging

3

0x00

method

Message ID

4

uint8array

data

The message

Response#

Byte

Type

Name

Description

0

0x20

hilen

Message type: Response

1

0x03

lolen

Minimum payload length

2

0xff

class

Message class:User messaging

3

0x00

method

Message ID

4-5

uint16

result

Result code

  • 0: success

  • Non-zero: an error occurred

For other values refer to the Error codes
6 | uint8array | data | The response message

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  
}  

user events#

user_message_to_host#

This event can be used by the target application on device to send a message to NCP host.

Event#

Byte

Type

Name

Description

0

0xa0

hilen

Message type: Event

1

0x01

lolen

Minimum payload length

2

0xff

class

Message class:User messaging

3

0x00

method

Message ID

4

uint8array

data

The message

API#

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