消息
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
[[+Zigbee30+EmberZnet]]
&color(red){※This article is based on EmberZnet SDK 6.7.5...
#contents
* 概要 [#w85d1a06]
消息发送有组播、广播、单播三种方式
*API [#qb9b2a05]
** 点播 [#y0dc43ac]
Sends unicast.
emberAfSendUnicast(EMBER_OUTGOING_VIA_BINDING 这个是通过...
#codeprettify{{
EmberStatus emberAfSendUnicast(EmberOutgoingMessageType ...
uint16_t indexOrDestination,
EmberApsFrame * apsFrame,
uint16_t messageLength,
uint8_t * message
)
}}
Sends unicast with attached message sent callback.
#codeprettify{{
EmberStatus emberAfSendUnicastWithCallback(EmberOutgoingM...
uint16_t indexOrDestination,
EmberApsFrame * apsFrame,
uint16_t messageLength,
uint8_t * message,
EmberAfMessageSentFunction callback
)
}}
** 广播 [#g8a53afc]
Multicasts the message to the group in the binding table ...
emberAfSendMulticastToBindings是将消息多播到绑定表中与APS...
#codeprettify{{
EmberStatus emberAfSendMulticastToBindings(EmberApsFrame ...
uint16_t messageLength,
uint8_t * message
)
}}
Sends multicast.
#codeprettify{{
EmberStatus emberAfSendMulticast(EmberMulticastId multic...
EmberApsFrame * apsFrame,
uint16_t messageLength,
uint8_t * message
)
}}
Sends multicast with attached message sent callback.
#codeprettify{{
EmberStatus emberAfSendMulticastWithCallback(EmberMultica...
EmberApsFrame * apsFrame,
uint16_t messageLength,
uint8_t * message,
EmberAfMessageSentFunction callback
)
}}
** 例程 [#z9267821]
*** 使用emAfApsFrameEndpointSetup函数设置源与目的端点 [#p...
#codeprettify{{
void emAfApsFrameEndpointSetup(uint8_t srcEndpoint,
uint8_t dstEndpoint)
{
globalApsFrame.sourceEndpoint = (srcEndpoint == 0
? emberAfPrimaryEndpoi...
: srcEndpoint);
globalApsFrame.destinationEndpoint = dstEndpoint;
}
}}
*** 将自定义的appZclBuffer数据发送出去 [#a79eef5a]
#codeprettify{{
EmberStatus emberAfSendMulticast(EmberMulticastId multica...
EmberApsFrame *apsFrame,
uint16_t messageLength,
uint8_t *message)
{
return emberAfSendMulticastWithCallback(multicastId,
apsFrame,
messageLength,
message,
NULL);
}
EmberStatus emberAfSendBroadcast(EmberNodeId destination,
EmberApsFrame *apsFrame,
uint16_t messageLength,
uint8_t *message)
{
return emberAfSendBroadcastWithCallback(destination,
apsFrame,
messageLength,
message,
NULL);
}
EmberStatus emberAfSendUnicast(EmberOutgoingMessageType t...
uint16_t indexOrDestination,
EmberApsFrame *apsFrame,
uint16_t messageLength,
uint8_t *message)
{
return emberAfSendUnicastWithCallback(type,
indexOrDestination,
apsFrame,
messageLength,
message,
NULL);
}
}}
*** EmberOutgoingMessageType [#z628bb0c]
#codeprettify{{
/** Unicast sent directly to an EmberNodeId. */
EMBER_OUTGOING_DIRECT,
/** Unicast sent using an entry in the address table. */
EMBER_OUTGOING_VIA_ADDRESS_TABLE,
/** Unicast sent using an entry in the binding table. */
EMBER_OUTGOING_VIA_BINDING,
/** Multicast message. This value is passed to emberMe...
* It may not be passed to emberSendUnicast(). */
EMBER_OUTGOING_MULTICAST,
/** An aliased multicast message. This value is passed...
* It may not be passed to emberSendUnicast(). */
EMBER_OUTGOING_MULTICAST_WITH_ALIAS,
/** An aliased Broadcast message. This value is passed...
* It may not be passed to emberSendUnicast(). */
EMBER_OUTGOING_BROADCAST_WITH_ALIAS,
/** A broadcast message. This value is passed to ember...
* It may not be passed to emberSendUnicast(). */
EMBER_OUTGOING_BROADCAST
}}
*** 调用 [#bb2db106]
应用实例(实现将0x55、0xABCD两个数据单播到协调器)
#codeprettify{{
static EmberStatus zclBufferSendToCoor(void) //发送到协调器
{
emAfApsFrameEndpointSetup(1, 1);
return emberAfSendUnicast(EMBER_OUTGOING_DIRECT,
COORDINATER_NETWORK_ID,
&globalApsFrame,
appZclBufferLen,
appZclBuffer);
}
void UnicastFunction(int16u data)
{
mfgSpecificId = EMBER_AF_MANUFACTURER_CODE;
zclXDefaultRespCommand = TRUE;
zclBufferSetup(ZCL_CLUSTER_SPECIFIC_COMMAND,
ZCL_XXX_CLUSTER_ID,
ZCL_XXX_COMMAND_ID);
mfgSpecificId = EMBER_AF_NULL_MANUFACTURER_CODE;
zclBufferAddWord(data);
if (zclBufferSendToCoor() == EMBER_SUCCESS) //成功
{
}
}
}}
&ref(ZigBee.png);
#hr();
Comment:
#comment_kcaptcha
終了行:
[[+Zigbee30+EmberZnet]]
&color(red){※This article is based on EmberZnet SDK 6.7.5...
#contents
* 概要 [#w85d1a06]
消息发送有组播、广播、单播三种方式
*API [#qb9b2a05]
** 点播 [#y0dc43ac]
Sends unicast.
emberAfSendUnicast(EMBER_OUTGOING_VIA_BINDING 这个是通过...
#codeprettify{{
EmberStatus emberAfSendUnicast(EmberOutgoingMessageType ...
uint16_t indexOrDestination,
EmberApsFrame * apsFrame,
uint16_t messageLength,
uint8_t * message
)
}}
Sends unicast with attached message sent callback.
#codeprettify{{
EmberStatus emberAfSendUnicastWithCallback(EmberOutgoingM...
uint16_t indexOrDestination,
EmberApsFrame * apsFrame,
uint16_t messageLength,
uint8_t * message,
EmberAfMessageSentFunction callback
)
}}
** 广播 [#g8a53afc]
Multicasts the message to the group in the binding table ...
emberAfSendMulticastToBindings是将消息多播到绑定表中与APS...
#codeprettify{{
EmberStatus emberAfSendMulticastToBindings(EmberApsFrame ...
uint16_t messageLength,
uint8_t * message
)
}}
Sends multicast.
#codeprettify{{
EmberStatus emberAfSendMulticast(EmberMulticastId multic...
EmberApsFrame * apsFrame,
uint16_t messageLength,
uint8_t * message
)
}}
Sends multicast with attached message sent callback.
#codeprettify{{
EmberStatus emberAfSendMulticastWithCallback(EmberMultica...
EmberApsFrame * apsFrame,
uint16_t messageLength,
uint8_t * message,
EmberAfMessageSentFunction callback
)
}}
** 例程 [#z9267821]
*** 使用emAfApsFrameEndpointSetup函数设置源与目的端点 [#p...
#codeprettify{{
void emAfApsFrameEndpointSetup(uint8_t srcEndpoint,
uint8_t dstEndpoint)
{
globalApsFrame.sourceEndpoint = (srcEndpoint == 0
? emberAfPrimaryEndpoi...
: srcEndpoint);
globalApsFrame.destinationEndpoint = dstEndpoint;
}
}}
*** 将自定义的appZclBuffer数据发送出去 [#a79eef5a]
#codeprettify{{
EmberStatus emberAfSendMulticast(EmberMulticastId multica...
EmberApsFrame *apsFrame,
uint16_t messageLength,
uint8_t *message)
{
return emberAfSendMulticastWithCallback(multicastId,
apsFrame,
messageLength,
message,
NULL);
}
EmberStatus emberAfSendBroadcast(EmberNodeId destination,
EmberApsFrame *apsFrame,
uint16_t messageLength,
uint8_t *message)
{
return emberAfSendBroadcastWithCallback(destination,
apsFrame,
messageLength,
message,
NULL);
}
EmberStatus emberAfSendUnicast(EmberOutgoingMessageType t...
uint16_t indexOrDestination,
EmberApsFrame *apsFrame,
uint16_t messageLength,
uint8_t *message)
{
return emberAfSendUnicastWithCallback(type,
indexOrDestination,
apsFrame,
messageLength,
message,
NULL);
}
}}
*** EmberOutgoingMessageType [#z628bb0c]
#codeprettify{{
/** Unicast sent directly to an EmberNodeId. */
EMBER_OUTGOING_DIRECT,
/** Unicast sent using an entry in the address table. */
EMBER_OUTGOING_VIA_ADDRESS_TABLE,
/** Unicast sent using an entry in the binding table. */
EMBER_OUTGOING_VIA_BINDING,
/** Multicast message. This value is passed to emberMe...
* It may not be passed to emberSendUnicast(). */
EMBER_OUTGOING_MULTICAST,
/** An aliased multicast message. This value is passed...
* It may not be passed to emberSendUnicast(). */
EMBER_OUTGOING_MULTICAST_WITH_ALIAS,
/** An aliased Broadcast message. This value is passed...
* It may not be passed to emberSendUnicast(). */
EMBER_OUTGOING_BROADCAST_WITH_ALIAS,
/** A broadcast message. This value is passed to ember...
* It may not be passed to emberSendUnicast(). */
EMBER_OUTGOING_BROADCAST
}}
*** 调用 [#bb2db106]
应用实例(实现将0x55、0xABCD两个数据单播到协调器)
#codeprettify{{
static EmberStatus zclBufferSendToCoor(void) //发送到协调器
{
emAfApsFrameEndpointSetup(1, 1);
return emberAfSendUnicast(EMBER_OUTGOING_DIRECT,
COORDINATER_NETWORK_ID,
&globalApsFrame,
appZclBufferLen,
appZclBuffer);
}
void UnicastFunction(int16u data)
{
mfgSpecificId = EMBER_AF_MANUFACTURER_CODE;
zclXDefaultRespCommand = TRUE;
zclBufferSetup(ZCL_CLUSTER_SPECIFIC_COMMAND,
ZCL_XXX_CLUSTER_ID,
ZCL_XXX_COMMAND_ID);
mfgSpecificId = EMBER_AF_NULL_MANUFACTURER_CODE;
zclBufferAddWord(data);
if (zclBufferSendToCoor() == EMBER_SUCCESS) //成功
{
}
}
}}
&ref(ZigBee.png);
#hr();
Comment:
#comment_kcaptcha
ページ名: