示例#1
0
bool nlme_discovery_response(nwk_enum_t Status, uint64_t DstIEEEAddr,
		uint8_t RecAppCapabilities, dev_type_t RecDevTypeList[3],
		profile_id_t RecProfileIdList[7], uint8_t DiscReqLQI)
{
	uint8_t *msg_buf;
	uint8_t i;
	msg_buf = get_next_tx_buffer();

	/* Check if buffer could not be allocated */
	if (NULL == msg_buf) {
		return false;
	}

	*msg_buf++ = NLME_DISCOVERY_RESP_LEN + RF4CONTROL_PID_LEN;
	*msg_buf++ = RF4CONTROL_PID;
	*msg_buf++ = NLME_DISCOVERY_RESPONSE;
	*msg_buf++ = Status;
	MEMCPY_ENDIAN(msg_buf, &DstIEEEAddr, sizeof(DstIEEEAddr));
	msg_buf += sizeof(uint64_t);
	*msg_buf++ = RecAppCapabilities;

	for (i = 0; i < DEVICE_TYPE_LIST_SIZE; i++) {
		*msg_buf++ = RecDevTypeList[i];
	}
	for (i = 0; i < PROFILE_ID_LIST_SIZE; i++) {
		*msg_buf++ = RecProfileIdList[i];
	}
	*msg_buf++ = DiscReqLQI;
	*msg_buf = EOT;
	return true;
}
示例#2
0
void nlde_data_indication(uint8_t PairingRef, profile_id_t ProfileId,
		uint16_t VendorId, uint8_t nsduLength, uint8_t *nsdu,
		uint8_t RxLinkQuality, uint8_t RxFlags)
{
	uint8_t *msg_buf;
	uint8_t *nsdu_ptr;
	uint8_t i;

	msg_buf = get_next_tx_buffer();
	*msg_buf++ = NLDE_DATA_IND_LEN + nsduLength + RF4CONTROL_PID_LEN;
	*msg_buf++ = RF4CONTROL_PID;
	*msg_buf++ = NLDE_DATA_INDICATION;
	*msg_buf++ = PairingRef;
	*msg_buf++ = ProfileId;
	*msg_buf++ = (uint8_t)VendorId; /* LSB */
	*msg_buf++ = (uint8_t)(VendorId >> 8); /* MSB */
	*msg_buf++ = RxLinkQuality;
	*msg_buf++ = RxFlags;
	*msg_buf++ = nsduLength;
	nsdu_ptr = nsdu;
	/* @ToDo use memcpy */
	for (i = 0; i < nsduLength; i++) {
		*msg_buf++ = *nsdu_ptr++;
	}
	*msg_buf = EOT;
}
示例#3
0
static void vendor_data_ind(uint8_t PairingRef, uint16_t VendorId,
		uint8_t nsduLength, uint8_t *nsdu, uint8_t RxLinkQuality,
		uint8_t RxFlags)
{
	uint8_t *msg_buf;
	uint8_t *nsdu_ptr;
	uint8_t i;

	msg_buf = get_next_tx_buffer();
	*msg_buf++ = 8 + nsduLength + RF4CONTROL_PID_LEN;
	*msg_buf++ = RF4CONTROL_PID;
	*msg_buf++ = VENDOR_DATA_INDICATION;
	*msg_buf++ = PairingRef;
	*msg_buf++ = PROFILE_ID_ZRC;
	*msg_buf++ = (uint8_t)(VendorId & 0xFF);
	*msg_buf++ = (uint8_t)(VendorId >> 8);
	*msg_buf++ = RxLinkQuality;
	*msg_buf++ = RxFlags;
	*msg_buf++ = nsduLength;
	nsdu_ptr = nsdu;
	/* @ToDo use memcpy */
	for (i = 0; i < nsduLength; i++) {
		*msg_buf++ = *nsdu_ptr++;
	}
	*msg_buf = EOT;
}
示例#4
0
bool pbp_rec_pair_request(uint8_t RecAppCapabilities,
		dev_type_t RecDevTypeList[3],
		profile_id_t RecProfileIdList[7],
		FUNC_PTR confirm_cb
		)
{
	uint8_t *msg_buf;
	uint8_t i;
	msg_buf = get_next_tx_buffer();

	/* Check if buffer could not be allocated */
	if (NULL == msg_buf) {
		return false;
	}

	if (confirm_cb == NULL) {
		return false;
	}

	pbp_rec_pair_confirm_cb = (pbp_rec_pair_confirm_cb_t)confirm_cb;

	*msg_buf++ = PBP_REC_PAIR_REQ_LEN + RF4CONTROL_PID_LEN;
	*msg_buf++ = RF4CONTROL_PID;
	*msg_buf++ = PBP_REC_PAIR_REQUEST;
	*msg_buf++ = RecAppCapabilities;

	for (i = 0; i < DEVICE_TYPE_LIST_SIZE; i++) {
		*msg_buf++ = RecDevTypeList[i];
	}
	for (i = 0; i < PROFILE_ID_LIST_SIZE; i++) {
		*msg_buf++ = RecProfileIdList[i];
	}
	*msg_buf = EOT;
	return true;
}
示例#5
0
bool nlme_pair_response(nwk_enum_t Status, uint16_t DstPANId,
		uint64_t DstIEEEAddr,
		uint8_t RecAppCapabilities, dev_type_t RecDevTypeList[3],
		profile_id_t RecProfileIdList[7], uint8_t ProvPairingRef)
{
	uint8_t *msg_buf;
	uint8_t i;
	msg_buf = get_next_tx_buffer();

	/* Check if buffer could not be allocated */
	if (NULL == msg_buf) {
		return false;
	}

	*msg_buf++ = NLME_PAIR_RESP_LEN + RF4CONTROL_PID_LEN;
	*msg_buf++ = RF4CONTROL_PID;
	*msg_buf++ = NLME_PAIR_RESPONSE;
	*msg_buf++ = Status;
	*msg_buf++ = (uint8_t)DstPANId; /* LSB */
	*msg_buf++ = (uint8_t)(DstPANId >> 8); /* MSB */
	MEMCPY_ENDIAN(msg_buf, &DstIEEEAddr, sizeof(DstIEEEAddr));
	msg_buf += sizeof(uint64_t);
	*msg_buf++ = RecAppCapabilities;

	for (i = 0; i < DEVICE_TYPE_LIST_SIZE; i++) {
		*msg_buf++ = RecDevTypeList[i];
	}
	for (i = 0; i < PROFILE_ID_LIST_SIZE; i++) {
		*msg_buf++ = RecProfileIdList[i];
	}
	*msg_buf++ = ProvPairingRef;
	*msg_buf = EOT;
	return true;
}
示例#6
0
static void nlme_comm_status_indication(nwk_enum_t Status, uint8_t PairingRef,
		uint16_t DstPANId, uint8_t DstAddrMode,
		uint64_t DstAddr)
{
	uint8_t *msg_buf;
	uint8_t *addr_ptr;
	uint8_t i;

	msg_buf = get_next_tx_buffer();
	*msg_buf++ = NLME_COMM_STATUS_IND_LEN + RF4CONTROL_PID_LEN;
	*msg_buf++ = RF4CONTROL_PID;
	*msg_buf++ = NLME_COMM_STATUS_INDICATION;
	*msg_buf++ = Status;
	*msg_buf++ = PairingRef;
#if (UC3) || (SAM)
	uint8_t *ptr = (uint8_t *)&DstPANId;
	*msg_buf++ = *ptr++;
	*msg_buf++ = *ptr;
#else
	*msg_buf++ = (uint8_t)DstPANId; /* LSB */
	*msg_buf++ = (uint8_t)(DstPANId >> 8); /* MSB */
#endif
	*msg_buf++ = DstAddrMode;
	/* @ToDo use memcpy */
	addr_ptr = (uint8_t *)&DstAddr;
	for (i = 0; i < 8; i++) {
		*msg_buf++ = *addr_ptr++;
	}
	*msg_buf = EOT;
}
示例#7
0
/**
 * @brief Handles the cmd discovery request.
 *
 * @param PairingRef    pairing ref of the originator device.
 *
 * @return true         if cmd discovery is sent using nlde_data_req.
 */
bool zrc_cmd_disc_request(uint8_t PairingRef,
		FUNC_PTR confirm_cb
		)
{
	uint8_t *msg_buf;
	msg_buf = get_next_tx_buffer();

	/* Check if buffer could not be allocated */
	if (NULL == msg_buf) {
		return false;
	}

	if (confirm_cb == NULL) {
		return false;
	}

	zrc_cmd_disc_confirm_cb = (zrc_cmd_disc_confirm_cb_t)confirm_cb;

	*msg_buf++ = ZRC_CMD_DISCOVERY_REQ_LEN + RF4CONTROL_PID_LEN;
	*msg_buf++ = RF4CONTROL_PID;
	*msg_buf++ = ZRC_CMD_DISCOVERY_REQUEST;
	*msg_buf++ = PairingRef;
	*msg_buf = EOT;
	return true;
}
示例#8
0
/* The NLME-RX-ENABLE.request primitive allows the application to request that
 * the
 * receiver is either enabled (for a finite period or until further notice) or
 * disabled. */
bool nlme_rx_enable_request(uint32_t RxOnDuration,
		FUNC_PTR confirm_cb
		)
{
	uint8_t *msg_buf;
	msg_buf = get_next_tx_buffer();

	/* Check if buffer could not be allocated */
	if (NULL == msg_buf) {
		return false;
	}

	if (confirm_cb == NULL) {
		return false;
	}

	nlme_rx_enable_confirm_cb = (nlme_rx_enable_confirm_cb_t)confirm_cb;

	*msg_buf++ = NLME_RX_ENABLE_REQ_LEN + RF4CONTROL_PID_LEN;
	*msg_buf++ = RF4CONTROL_PID;
	*msg_buf++ = NLME_RX_ENABLE_REQUEST;
	MEMCPY_ENDIAN(msg_buf, &RxOnDuration, sizeof(RxOnDuration));
	msg_buf += sizeof(uint32_t);
	*msg_buf = EOT;
	return true;
}
示例#9
0
bool nlme_get_request(nib_attribute_t NIBAttribute, uint8_t NIBAttributeIndex,
		FUNC_PTR confirm_cb
		)
{
	uint8_t *msg_buf;
	msg_buf = get_next_tx_buffer();

	/* Check if buffer could not be allocated */
	if (NULL == msg_buf) {
		return false;
	}

	if (confirm_cb == NULL) {
		return false;
	}

	nlme_get_confirm_cb = (nlme_get_confirm_cb_t)confirm_cb;

	*msg_buf++ = NLME_GET_REQ_LEN + RF4CONTROL_PID_LEN;
	*msg_buf++ = RF4CONTROL_PID;
	*msg_buf++ = NLME_GET_REQUEST;
	*msg_buf++ = NIBAttribute;
	*msg_buf++ = NIBAttributeIndex;
	*msg_buf = EOT;
	return true;
}
示例#10
0
bool nlme_update_key_request(uint8_t PairingRef, uint8_t NewLinkKey[16],
		FUNC_PTR confirm_cb
		)
{
	uint8_t *msg_buf;
	uint8_t *ptr;
	uint8_t i;
	msg_buf = get_next_tx_buffer();

	/* Check if buffer could not be allocated */
	if (NULL == msg_buf) {
		return false;
	}

	if (confirm_cb == NULL) {
		return false;
	}

	nlme_update_key_confirm_cb = (nlme_update_key_confirm_cb_t)confirm_cb;

	*msg_buf++ = NLME_UPDATE_KEY_REQ_LEN + RF4CONTROL_PID_LEN;
	*msg_buf++ = RF4CONTROL_PID;
	*msg_buf++ = NLME_UPDATE_KEY_REQUEST;
	*msg_buf++ = PairingRef;
	ptr = NewLinkKey;
	for (i = 0; i < 16; i++) {
		*msg_buf++ = *ptr++;
	}
	*msg_buf = EOT;
	return true;
}
示例#11
0
bool nlme_unpair_request(uint8_t PairingRef,
		FUNC_PTR confirm_cb
		)
{
	uint8_t *msg_buf;
	msg_buf = get_next_tx_buffer();

	/* Check if buffer could not be allocated */
	if (NULL == msg_buf) {
		return false;
	}

	if (confirm_cb == NULL) {
		return false;
	}

	nlme_unpair_confirm_cb = (nlme_unpair_confirm_cb_t)confirm_cb;

	*msg_buf++ = NLME_UNPAIR_REQ_LEN + RF4CONTROL_PID_LEN;
	*msg_buf++ = RF4CONTROL_PID;
	*msg_buf++ = NLME_UNPAIR_REQUEST;
	*msg_buf++ = PairingRef;
	*msg_buf = EOT;
	return true;
}
示例#12
0
bool nwk_ch_agility_request(nwk_agility_mode_t AgilityMode,
		FUNC_PTR confirm_cb
		)
{
	uint8_t *msg_buf;
	msg_buf = get_next_tx_buffer();

	/* Check if buffer could not be allocated */
	if (NULL == msg_buf) {
		return false;
	}

	if (confirm_cb == NULL) {
		return false;
	}

	nwk_ch_agility_confirm_cb = (nwk_ch_agility_confirm_cb_t)confirm_cb;

	*msg_buf++ = NWK_CH_AGILITY_REQ_LEN + RF4CONTROL_PID_LEN;
	*msg_buf++ = RF4CONTROL_PID;
	*msg_buf++ = NWK_CH_AGILITY_REQUEST;
	*msg_buf++ = AgilityMode;
	*msg_buf = EOT;
	return true;
}
示例#13
0
bool nlme_reset_request(bool SetDefaultNIB,
		FUNC_PTR confirm_cb
		)
{
	uint8_t *msg_buf;
	msg_buf = get_next_tx_buffer();

	/* Check if buffer could not be allocated */
	if (NULL == msg_buf) {
		return false;
	}

	if (confirm_cb == NULL) {
		return false;
	}

	nlme_reset_confirm_cb = (nlme_reset_confirm_cb_t)confirm_cb;

	*msg_buf++ = NLME_RESET_REQ_LEN + RF4CONTROL_PID_LEN;
	*msg_buf++ = RF4CONTROL_PID;
	*msg_buf++ = NLME_RESET_REQUEST;
	*msg_buf++ = SetDefaultNIB;
	*msg_buf = EOT;
	return true;
}
示例#14
0
static void nlme_start_confirm(nwk_enum_t Status)
{
	uint8_t *msg_buf;

	msg_buf = get_next_tx_buffer();
	*msg_buf++ = NLME_START_CONF_LEN + RF4CONTROL_PID_LEN;
	*msg_buf++ = RF4CONTROL_PID;
	*msg_buf++ = NLME_START_CONFIRM;
	*msg_buf++ = Status;
	*msg_buf = EOT;
}
示例#15
0
void nwk_ch_agility_indication(uint8_t LogicalChannel)
{
	uint8_t *msg_buf;

	msg_buf = get_next_tx_buffer();
	*msg_buf++ = NWK_CH_AGILITY_IND_LEN + RF4CONTROL_PID_LEN;
	*msg_buf++ = RF4CONTROL_PID;
	*msg_buf++ = NWK_CH_AGILITY_INDICATION;
	*msg_buf++ = LogicalChannel;
	*msg_buf = EOT;
}
示例#16
0
void nlme_unpair_indication(uint8_t PairingRef)
{
	uint8_t *msg_buf;

	msg_buf = get_next_tx_buffer();
	*msg_buf++ = NLME_UNPAIR_IND_LEN + RF4CONTROL_PID_LEN;
	*msg_buf++ = RF4CONTROL_PID;
	*msg_buf++ = NLME_UNPAIR_INDICATION;
	*msg_buf++ = PairingRef;
	*msg_buf = EOT;
}
示例#17
0
static void nlme_rx_enable_confirm(nwk_enum_t Status)
{
	uint8_t *msg_buf;

	msg_buf = get_next_tx_buffer();
	*msg_buf++ = NLME_RX_ENABLE_CONF_LEN + RF4CONTROL_PID_LEN;
	*msg_buf++ = RF4CONTROL_PID;
	*msg_buf++ = NLME_RX_ENABLE_CONFIRM;
	*msg_buf++ = Status;
	*msg_buf = EOT;
}
示例#18
0
static void zrc_cmd_disc_indication(uint8_t PairingRef)
{
	uint8_t *msg_buf;

	msg_buf = get_next_tx_buffer();
	*msg_buf++ = 2 + RF4CONTROL_PID_LEN;
	*msg_buf++ = RF4CONTROL_PID;
	*msg_buf++ = ZRC_CMD_DISCOVERY_INDICATION;
	*msg_buf++ = PairingRef;
	*msg_buf = EOT;
}
示例#19
0
static void nlme_update_key_confirm(nwk_enum_t Status, uint8_t PairingRef)
{
	uint8_t *msg_buf;

	msg_buf = get_next_tx_buffer();
	*msg_buf++ = NLME_UPDATE_KEY_CONF_LEN + RF4CONTROL_PID_LEN;
	*msg_buf++ = RF4CONTROL_PID;
	*msg_buf++ = NLME_UPDATE_KEY_CONFIRM;
	*msg_buf++ = Status;
	*msg_buf++ = PairingRef;
	*msg_buf = EOT;
}
示例#20
0
static void nlme_unpair_confirm(uint8_t Status, uint8_t PairingRef)
{
	uint8_t *msg_buf;

	msg_buf = get_next_tx_buffer();
	*msg_buf++ = NLME_UNPAIR_CONF_LEN + RF4CONTROL_PID_LEN;
	*msg_buf++ = RF4CONTROL_PID;
	*msg_buf++ = NLME_UNPAIR_CONFIRM;
	*msg_buf++ = Status;
	*msg_buf++ = PairingRef;
	*msg_buf = EOT;
}
示例#21
0
static void pbp_rec_pair_confirm(nwk_enum_t Status, uint8_t PairingRef)
{
	uint8_t *msg_buf;

	msg_buf = get_next_tx_buffer();
	*msg_buf++ = 3 + RF4CONTROL_PID_LEN;
	*msg_buf++ = RF4CONTROL_PID;
	*msg_buf++ = PBP_REC_PAIR_CONFIRM;
	*msg_buf++ = Status;
	*msg_buf++ = PairingRef;
	*msg_buf = EOT;
}
示例#22
0
bool nlme_discovery_request(uint16_t DstPANId, uint16_t DstNwkAddr,
		uint8_t OrgAppCapabilities,
		dev_type_t OrgDevTypeList[3],
		profile_id_t OrgProfileIdList[7],
		dev_type_t SearchDevType,
		uint8_t DiscProfileIdListSize,
		profile_id_t DiscProfileIdList[7],
		uint32_t DiscDuration,
		FUNC_PTR confirm_cb
		)
{
	uint8_t *msg_buf;
	uint8_t i;
	msg_buf = get_next_tx_buffer();

	/* Check if buffer could not be allocated */
	if (NULL == msg_buf) {
		return false;
	}

	if (confirm_cb == NULL) {
		return false;
	}

	nlme_discovery_confirm_cb = (nlme_discovery_confirm_cb_t)confirm_cb;

	*msg_buf++ = NLME_DISCOVERY_REQ_LEN + RF4CONTROL_PID_LEN;
	*msg_buf++ = RF4CONTROL_PID;
	*msg_buf++ = NLME_DISCOVERY_REQUEST;
	*msg_buf++ = (uint8_t)DstPANId; /* LSB */
	*msg_buf++ = (uint8_t)(DstPANId >> 8); /* MSB */
	*msg_buf++ = (uint8_t)DstNwkAddr; /* LSB */
	*msg_buf++ = (uint8_t)(DstNwkAddr >> 8); /* MSB */
	*msg_buf++ = OrgAppCapabilities;
	for (i = 0; i < DEVICE_TYPE_LIST_SIZE; i++) {
		*msg_buf++ = OrgDevTypeList[i];
	}
	for (i = 0; i < PROFILE_ID_LIST_SIZE; i++) {
		*msg_buf++ = OrgProfileIdList[i];
	}

	*msg_buf++ = SearchDevType;
	*msg_buf++ = DiscProfileIdListSize;
	for (i = 0; i < PROFILE_ID_LIST_SIZE; i++) {
		*msg_buf++ = DiscProfileIdList[i];
	}

	memcpy(msg_buf, &DiscDuration, sizeof(uint32_t));
	msg_buf += sizeof(uint32_t);
	*msg_buf = EOT;
	return true;
}
示例#23
0
static void nlme_set_confirm(nwk_enum_t Status, nib_attribute_t NIBAttribute,
		uint8_t NIBAttributeIndex)
{
	uint8_t *msg_buf;

	msg_buf = get_next_tx_buffer();
	*msg_buf++ = NLME_SET_CONF_LEN + RF4CONTROL_PID_LEN;
	*msg_buf++ = RF4CONTROL_PID;
	*msg_buf++ = NLME_SET_CONFIRM;
	*msg_buf++ = Status;
	*msg_buf++ = NIBAttribute;
	*msg_buf++ = NIBAttributeIndex;
	*msg_buf = EOT;
}
示例#24
0
static void nwk_ch_agility_confirm(nwk_enum_t Status, bool ChannelChanged,
		uint8_t LogicalChannel)
{
	uint8_t *msg_buf;

	msg_buf = get_next_tx_buffer();
	*msg_buf++ = NWK_CH_AGILITY_CONF_LEN + RF4CONTROL_PID_LEN;
	*msg_buf++ = RF4CONTROL_PID;
	*msg_buf++ = NWK_CH_AGILITY_CONFIRM;
	*msg_buf++ = Status;
	*msg_buf++ = (uint8_t)ChannelChanged;
	*msg_buf++ = LogicalChannel;
	*msg_buf = EOT;
}
示例#25
0
static void zrc_cmd_confirm(nwk_enum_t Status, uint8_t PairingRef,
		cec_code_t RcCmd)
{
	uint8_t *msg_buf;

	msg_buf = get_next_tx_buffer();
	*msg_buf++ = 4 + RF4CONTROL_PID_LEN;
	*msg_buf++ = RF4CONTROL_PID;
	*msg_buf++ = ZRC_CMD_CONFIRM;
	*msg_buf++ = Status;
	*msg_buf++ = PairingRef;
	*msg_buf++ = RcCmd;
	*msg_buf = EOT;
}
示例#26
0
/* The NLME-UNPAIR.response primitive allows the application to notify the NLME
 * that the pairing link indicated via the NLME-UNPAIR.indication primitive can
 * be
 * removed from the pairing table. */
bool nlme_unpair_response(uint8_t PairingRef)
{
	uint8_t *msg_buf;
	msg_buf = get_next_tx_buffer();

	/* Check if buffer could not be allocated */
	if (NULL == msg_buf) {
		return false;
	}

	*msg_buf++ = NLME_UNPAIR_RESP_LEN + RF4CONTROL_PID_LEN;
	*msg_buf++ = RF4CONTROL_PID;
	*msg_buf++ = NLME_UNPAIR_RESPONSE;
	*msg_buf++ = PairingRef;
	*msg_buf = EOT;
	return true;
}
示例#27
0
static void zrc_cmd_disc_confirm(nwk_enum_t Status, uint8_t PairingRef,
		uint8_t *SupportedCmd)
{
	uint8_t *msg_buf;
	uint8_t i;

	msg_buf = get_next_tx_buffer();
	*msg_buf++ = 35 + RF4CONTROL_PID_LEN;
	*msg_buf++ = RF4CONTROL_PID;
	*msg_buf++ = ZRC_CMD_DISCOVERY_CONFIRM;
	*msg_buf++ = Status;
	*msg_buf++ = PairingRef;
	for (i = 0; i < 32; i++) {
		*msg_buf++ = *SupportedCmd++;
	}
	*msg_buf = EOT;
}
示例#28
0
static void nlme_auto_discovery_confirm(nwk_enum_t Status, uint64_t SrcIEEEAddr)
{
	uint8_t *msg_buf;
	uint8_t *addr_ptr;
	uint8_t i;

	msg_buf = get_next_tx_buffer();
	*msg_buf++ = NLME_AUTO_DISCOVERY_CONF_LEN + RF4CONTROL_PID_LEN;
	*msg_buf++ = RF4CONTROL_PID;
	*msg_buf++ = NLME_AUTO_DISCOVERY_CONFIRM;
	*msg_buf++ = Status;
	addr_ptr = (uint8_t *)&SrcIEEEAddr;
	/* @ToDo use memcpy */
	for (i = 0; i < 8; i++) {
		*msg_buf++ = *addr_ptr++;
	}
	*msg_buf = EOT;
}
示例#29
0
bool nlme_pair_request(uint8_t LogicalChannel, uint16_t DstPANId,
		uint64_t DstIEEEAddr,
		uint8_t OrgAppCapabilities,
		dev_type_t OrgDevTypeList[DEVICE_TYPE_LIST_SIZE],
		profile_id_t OrgProfileIdList[PROFILE_ID_LIST_SIZE],
		uint8_t KeyExTransferCount,
		FUNC_PTR confirm_cb
		)
{
	uint8_t *msg_buf;
	uint8_t i;
	msg_buf = get_next_tx_buffer();

	/* Check if buffer could not be allocated */
	if (NULL == msg_buf) {
		return false;
	}

	if (confirm_cb == NULL) {
		return false;
	}

	nlme_pair_confirm_cb = (nlme_pair_confirm_cb_t)confirm_cb;

	*msg_buf++ = NLME_PAIR_REQ_LEN + RF4CONTROL_PID_LEN;
	*msg_buf++ = RF4CONTROL_PID;
	*msg_buf++ = NLME_PAIR_REQUEST;
	*msg_buf++ = LogicalChannel;
	*msg_buf++ = (uint8_t)DstPANId; /* LSB */
	*msg_buf++ = (uint8_t)(DstPANId >> 8); /* MSB */
	memcpy(msg_buf, &DstIEEEAddr, sizeof(DstIEEEAddr));
	msg_buf += sizeof(uint64_t);
	*msg_buf++ = OrgAppCapabilities;

	for (i = 0; i < DEVICE_TYPE_LIST_SIZE; i++) {
		*msg_buf++ = OrgDevTypeList[i];
	}
	for (i = 0; i < PROFILE_ID_LIST_SIZE; i++) {
		*msg_buf++ = OrgProfileIdList[i];
	}
	*msg_buf++ = KeyExTransferCount;
	*msg_buf = EOT;
	return true;
}
示例#30
0
void vendor_data_confirm(nwk_enum_t Status, uint8_t PairingRef,
		profile_id_t ProfileId,
		uint8_t Handle
		)
{
	uint8_t *msg_buf;

	msg_buf = get_next_tx_buffer();
	*msg_buf++ = 3 + RF4CONTROL_PID_LEN;
	*msg_buf++ = RF4CONTROL_PID;
	*msg_buf++ = VENDOR_DATA_CONFIRM;
	*msg_buf++ = Status;
	*msg_buf++ = PairingRef;
	*msg_buf = EOT;
	/* Keeps compiler Happy */
	ProfileId = ProfileId;

	Handle = Handle;
}