This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2530: using AF_DATA_REQUEST_EXT on CC2530 little help

Part Number: CC2530
Other Parts Discussed in Thread: Z-STACK

hi

im trying to use AF_DATA_REQUEST_EXT  to use IEEE address of each cc2530 to send data to them

im using znp

this is what i should send

lenth of mine is 0x1B

CMD0 = 0x24

CMD1=0x02

DstAddrMode = 0x03
DstAddr = device ieee adress that i have
DstEndpoint=?
DstPanId=?
SrcEndpoint=?
ClusterId=?
TransId=?
Options=?
Radius=?
Len=0x08
Data = 8byte data


i didn't set pan id so it in default that i think it would be 0xFFFF

please, someone, tell me what should i replace with? signs?

if someone can help me to find out what these r exactly ill be so thankful






  • You can refer to Z-Stack Monitor and Test API.pdf in document folder
  • i saw it and screenshot is from there
    but i dont get all of them

    please tell me how to use 

    AF_DATA_REQUEST_EXT

  • Each Zigbee device has endpoint. Source endpoint means the endpoint of device sending the message. Destination endpoint means the endpoint of device receiving the message. PANID can be get from _NIB data structure. TransID is a sequence number assigned by application to differentiate each message and it can between 1 and 255. For options and radius, you can use 0.
  • i send this via usart to znp
    FEh 1Bh 24h 02h 03h 00h 12h 4Bh 00h 0Fh 6Bh 60h E6h 01h FFh FFh 01h 00h 06h 00h 00h 00h 08h 6Eh 6Eh 6Eh 6Eh 6Eh 6Eh 6Eh 6Eh 8Bh
    and znp return
    FEh 01h 64h 02h 10h 77h
    iee iddress is correct and connected to zigbee device but data is not apperaing in other device
  • 1.we register our zigbee with af register to give a endpoint number to each device , right?
    2.Source endpoint is the device that currently sending data , right? why we should fill it . its abviuos who sending data
    3.i didnt get this part "PANID can be get from _NIB data structure" where is this _NIB ?
    4.we can use TransID to send various data like temp TransID is 1 and battery charge TransID is 2 , right?

    5.i can set pan id with UTIL_SET_PANIDright? and use it in DstPanId in AF_DATA_REQUEST_EXT right?

  • Try to reverse byte order of your IEEE address.
  • i did reverse it but didnt work either
    thanks allot for ur attention
    some q that i hoped maybe u consider answering

    1.we register our zigbee with af register to give a endpoint number to each device , right?
    2.Source endpoint is the device that currently sending data , right? why we should fill it . its abviuos who sending data
    3.i didnt get this part "PANID can be get from _NIB data structure" where is this _NIB ?
    4.we can use TransID to send various data like temp TransID is 1 and battery charge TransID is 2 , right?
    5.i can set pan id with UTIL_SET_PANIDright? and use it in DstPanId in AF_DATA_REQUEST_EXT right?
  • 1. Yes
    2. Yes. A device might have more than one endpoint so you have to specify it.
    3. Since you are using ZNP, you cannot access to _NIB directly. You can try to use 0 as PANID field.
    4. Each message should have different sequence number so you should increment it every time you send a new message.
    5. No, PANID is assigned by coordinator when Zigbee network is formed.
  • can u give me an example of  AF_DATA_REQUEST_EXT that works with ztool to test it there?

    thanks allot

  • please see this 

    coordinator

    Start Time: 10/16/2017 9:11:01 AM
    
    
    <TX>09:11:39.08 COM12 SYS_OSAL_NV_WRITE (0x2109)
        Id: 0x0003
        Offset: 0x00
        Len: 0x01
        Value: . (0x03)
    
    <RX>09:11:39.11 COM12 SYS_OSAL_NV_WRITE_SRSP (0x6109)
        Status: SUCCESS (0x0)
    
    
    <TX>09:15:33.75 COM12 SYS_RESET (0x4100)
        Type: 0x00 (HARD RESET) (0x0)
    
    <RX>09:15:35.42 COM12 SYS_RESET_RESPONSE (0x4180)
        Reason: 0x02
        TransportRev: 0x02
        Product: 0x00
        MajorRel: 0x02
        MinorRel: 0x07
        HwRev: 0x00
    
    <TX>09:15:41.47 COM12 SYS_OSAL_NV_WRITE (0x2109)
        Id: 0x008F
        Offset: 0x00
        Len: 0x01
        Value: . (0x01)
    
    <RX>09:15:41.48 COM12 SYS_OSAL_NV_WRITE_SRSP (0x6109)
        Status: SUCCESS (0x0)
    
    <TX>09:15:50.5 COM12 SYS_OSAL_NV_WRITE (0x2109)
        Id: 0x0087
        Offset: 0x00
        Len: 0x01
        Value: . (0x00)
    
    <RX>09:15:50.51 COM12 SYS_OSAL_NV_WRITE_SRSP (0x6109)
        Status: SUCCESS (0x0)
    
    <TX>09:15:56.89 COM12 AF_REGISTER (0x2400)
        EndPoint: 0x01
        AppProfID: 0x0001
        AppDeviceId: 0x0001
        AppDevVer: 0x00
        LatencyReq: NO_LATENCY_REQS (0x0)
        AppNumInClusters: 0x02
        AppInClusterList: 0x0000, 0x0006
        AppNumOutClusters: 0x02
        AppOutClusterList: 0x0000, 0x0006
    
    <RX>09:15:56.9 COM12 AF_REGISTER_SRSP (0x6400)
        Status: afStatus_SUCCESS (0x0)
    
    <TX>09:16:01.58 COM12 APP_CNF_BDB_SET_CHANNEL (0x2F08)
        isPrimary: TRUE (0x1)
        Channel: CHNL_0x00002000 (0x2000)
    
    <RX>09:16:01.59 COM12 APP_CNF_BDB_SET_CHANNEL_SRSP (0x6F08)
        Status: SUCCESS (0x0)
    
    <TX>09:16:08.96 COM12 APP_CNF_BDB_SET_CHANNEL (0x2F08)
        isPrimary: FALSE (0x0)
        Channel: NONE (0x0)
    
    <RX>09:16:08.97 COM12 APP_CNF_BDB_SET_CHANNEL_SRSP (0x6F08)
        Status: SUCCESS (0x0)
    
    <TX>09:16:17.47 COM12 APP_CNF_BDB_START_COMMISSIONING (0x2F05)
        CommissioningMode: (0x04) Network Formation (0x4)
    
    <RX>09:16:19 COM12 APP_CNF_BDB_START_COMMISSIONING_SRSP (0x6F05)
        Status: SUCCESS (0x0)
    
    <RX>09:16:19 COM12 ZDO_STATE_CHANGE_IND (0x45C0)
        State: 8 (0x8)
    
    <RX>09:16:19.01 COM12 APP_CNF_BDB_COMMISSIONING_NOTIFICATION (0x4F80)
        Status: 1 (0x1)
        Commissioning Mode: 0x02 (Formation) (0x2)
        Commissioning Mode: 101 (0x65)
    
    <RX>09:16:19.27 COM12 ZDO_STATE_CHANGE_IND (0x45C0)
        State: 8 (0x8)
    
    <RX>09:16:19.53 COM12 ZDO_STATE_CHANGE_IND (0x45C0)
        State: 8 (0x8)
    
    <RX>09:16:19.8 COM12 ZDO_STATE_CHANGE_IND (0x45C0)
        State: 8 (0x8)
    
    <RX>09:16:20.06 COM12 ZDO_STATE_CHANGE_IND (0x45C0)
        State: 8 (0x8)
    
    <RX>09:16:20.33 COM12 ZDO_STATE_CHANGE_IND (0x45C0)
        State: 8 (0x8)
    
    <RX>09:16:20.59 COM12 ZDO_STATE_CHANGE_IND (0x45C0)
        State: 8 (0x8)
    
    <RX>09:16:20.86 COM12 ZDO_STATE_CHANGE_IND (0x45C0)
        State: 8 (0x8)
    
    <RX>09:16:21.12 COM12 ZDO_STATE_CHANGE_IND (0x45C0)
        State: 8 (0x8)
    
    <RX>09:16:21.68 COM12 ZDO_STATE_CHANGE_IND (0x45C0)
        State: 9 (0x9)
    
    <RX>09:16:21.68 COM12 APP_CNF_BDB_COMMISSIONING_NOTIFICATION (0x4F80)
        Status: 0x00 (Success) (0x0)
        Commissioning Mode: 0x02 (Formation) (0x2)
        Commissioning Mode: 0x01 (Initiator TL), 0x04 (Network Formation), 0x08 (Finding and Binding), 0x20 (Parent Lost) (0x2D)
    
    <TX>09:16:26.72 COM12 APP_CNF_BDB_START_COMMISSIONING (0x2F05)
        CommissioningMode: (0x02) Network Steering (0x2)
    
    <RX>09:16:26.73 COM12 APP_CNF_BDB_START_COMMISSIONING_SRSP (0x6F05)
        Status: SUCCESS (0x0)
    
    <RX>09:16:26.75 COM12 ZDO_MGMT_PERMIT_JOIN_RSP (0x45B6)
        SrcAddr: 0x0000
        Status: ZDP_SUCCESS (0x0)
    
    <RX>09:16:26.77 COM12 APP_CNF_BDB_COMMISSIONING_NOTIFICATION (0x4F80)
        Status: 0x00 (Success) (0x0)
        Commissioning Mode: 0x01 (Network Steering) (0x1)
        Commissioning Mode: 227 (0xE3)
    
    *** WARNING ***
        Unsupported or unformatted message received.  Raw data: 
        0C 45 CA D0 EE E6 60 6B 0F 00 4B 12 00 00 00 
    
    <RX>09:17:29.17 COM12 ZDO_END_DEVICE_ANNCE_IND (0x45C1)
        SrcAddr: 0xEED0
        NwkAddr: 0xEED0
        IEEEAddr: 0x00124B000F6B60E6
        Capabilities: 0x8E
    
    <TX>09:20:19.86 COM12 AF_DATA_REQUEST_EXT (0x2402)
        DstAddrMode: 0x03 (ADDRESS_64_BIT) (0x3)
        DstAddr: ..K..k`. (0x00, 0x12, 0x4B, 0x00, 0x0F, 0x6B, 0x60, 0xE6)
        DstEndPoint: 0x01
        DstPanId: 0x0000
        SrcEndpoint: 0x01
        ClusterID: 0x0000
        TransID: 0x00
        Options: 0x00
        Radius: 0x00
        Len: 0x0008
        Data: ........ (0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07)
    
    <RX>09:20:19.88 COM12 AF_DATA_REQUEST_EXT_SRSP (0x6402)
        Status: 194 (0xC2)
    
    <TX>09:20:59.03 COM12 AF_DATA_REQUEST_EXT (0x2402)
        DstAddrMode: 0x03 (ADDRESS_64_BIT) (0x3)
        DstAddr: ..K..k`. (0x00, 0x12, 0x4B, 0x00, 0x0F, 0x6B, 0x60, 0xE6)
        DstEndPoint: 0x01
        DstPanId: 0x0000
        SrcEndpoint: 0x01
        ClusterID: 0x0006
        TransID: 0x00
        Options: 0x00
        Radius: 0x00
        Len: 0x0008
        Data: ........ (0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07)
    
    <RX>09:20:59.04 COM12 AF_DATA_REQUEST_EXT_SRSP (0x6402)
        Status: 194 (0xC2)
    
    <TX>09:21:06.83 COM12 AF_DATA_REQUEST_EXT (0x2402)
        DstAddrMode: 0x03 (ADDRESS_64_BIT) (0x3)
        DstAddr: ..K..k`. (0x00, 0x12, 0x4B, 0x00, 0x0F, 0x6B, 0x60, 0xE6)
        DstEndPoint: 0x01
        DstPanId: 0x0000
        SrcEndpoint: 0x01
        ClusterID: 0x0002
        TransID: 0x00
        Options: 0x00
        Radius: 0x00
        Len: 0x0008
        Data: ........ (0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07)
    
    <RX>09:21:06.84 COM12 AF_DATA_REQUEST_EXT_SRSP (0x6402)
        Status: 194 (0xC2)
    
    <TX>09:21:13.5 COM12 AF_DATA_REQUEST_EXT (0x2402)
        DstAddrMode: 0x03 (ADDRESS_64_BIT) (0x3)
        DstAddr: ..K..k`. (0x00, 0x12, 0x4B, 0x00, 0x0F, 0x6B, 0x60, 0xE6)
        DstEndPoint: 0x01
        DstPanId: 0x0000
        SrcEndpoint: 0x01
        ClusterID: 0x0001
        TransID: 0x00
        Options: 0x00
        Radius: 0x00
        Len: 0x0008
        Data: ........ (0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07)
    
    <RX>09:21:13.51 COM12 AF_DATA_REQUEST_EXT_SRSP (0x6402)
        Status: 194 (0xC2)
    
    <TX>09:21:24.99 COM12 AF_DATA_REQUEST_EXT (0x2402)
        DstAddrMode: 0x03 (ADDRESS_64_BIT) (0x3)
        DstAddr: ..K..k`. (0x00, 0x12, 0x4B, 0x00, 0x0F, 0x6B, 0x60, 0xE6)
        DstEndPoint: 0x01
        DstPanId: 0x0000
        SrcEndpoint: 0x01
        ClusterID: 0x0006
        TransID: 0x01
        Options: 0x00
        Radius: 0x00
        Len: 0x0008
        Data: ........ (0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07)
    
    <RX>09:21:25.01 COM12 AF_DATA_REQUEST_EXT_SRSP (0x6402)
        Status: 194 (0xC2)
    
    <TX>09:23:44.97 COM12 UTIL_GET_DEVICE_INFO (0x2700)
    
    <RX>09:23:44.98 COM12 UTIL_GET_DEVICE_INFO_RESPONSE (0x6700)
        Status: SUCCESS (0x0)
        IEEEAddr: 0x00124B000F6B62C0
        ShortAddress: 0x0000
        DeviceType: COORDINATOR, ROUTER, END_DEVICE (0x7)
        DeviceState: DEV_ZB_COORD (0x9)
        NumAssocDevices: 0x00
        AssocDevicesList
    
    <TX>09:24:52.3 COM12 AF_DATA_REQUEST_EXT (0x2402)
        DstAddrMode: 0x03 (ADDRESS_64_BIT) (0x3)
        DstAddr: ..K..k`. (0x00, 0x12, 0x4B, 0x00, 0x0F, 0x6B, 0x60, 0xE6)
        DstEndPoint: 0x01
        DstPanId: 0x0000
        SrcEndpoint: 0x01
        ClusterID: 0x0001
        TransID: 0x01
        Options: 0x00
        Radius: 0x00
        Len: 0x0008
        Data: ........ (0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07)
    
    <RX>09:24:52.31 COM12 AF_DATA_REQUEST_EXT_SRSP (0x6402)
        Status: 194 (0xC2)
    

    rooter

    Start Time: 10/16/2017 9:11:01 AM
    
    <TX>09:16:45.59 COM4 SYS_OSAL_NV_WRITE (0x2109)
        Id: 0x0003
        Offset: 0x00
        Len: 0x01
        Value: . (0x03)
    
    <RX>09:16:45.62 COM4 SYS_OSAL_NV_WRITE_SRSP (0x6109)
        Status: SUCCESS (0x0)
    
    <TX>09:16:48 COM4 SYS_RESET (0x4100)
        Type: 0x00 (HARD RESET) (0x0)
    
    <RX>09:16:49.66 COM4 SYS_RESET_RESPONSE (0x4180)
        Reason: 0x02
        TransportRev: 0x02
        Product: 0x00
        MajorRel: 0x02
        MinorRel: 0x07
        HwRev: 0x00
    
    <TX>09:17:00.08 COM4 SYS_OSAL_NV_WRITE (0x2109)
        Id: 0x0087
        Offset: 0x00
        Len: 0x01
        Value: . (0x01)
    
    <RX>09:17:00.09 COM4 SYS_OSAL_NV_WRITE_SRSP (0x6109)
        Status: SUCCESS (0x0)
    
    <TX>09:17:05.86 COM4 APP_CNF_BDB_SET_CHANNEL (0x2F08)
        isPrimary: FALSE (0x0)
        Channel: NONE (0x0)
    
    <RX>09:17:05.87 COM4 APP_CNF_BDB_SET_CHANNEL_SRSP (0x6F08)
        Status: SUCCESS (0x0)
    
    <TX>09:17:16.99 COM4 APP_CNF_BDB_SET_CHANNEL (0x2F08)
        isPrimary: TRUE (0x1)
        Channel: CHNL_0x00002000 (0x2000)
    
    <RX>09:17:17 COM4 APP_CNF_BDB_SET_CHANNEL_SRSP (0x6F08)
        Status: SUCCESS (0x0)
    
    <TX>09:17:25.29 COM4 APP_CNF_BDB_START_COMMISSIONING (0x2F05)
        CommissioningMode: (0x02) Network Steering (0x2)
    
    <RX>09:17:26.72 COM4 APP_CNF_BDB_START_COMMISSIONING_SRSP (0x6F05)
        Status: SUCCESS (0x0)
    
    <RX>09:17:26.72 COM4 ZDO_STATE_CHANGE_IND (0x45C0)
        State: INVALID_PARAMETER (0x2)
    
    <RX>09:17:26.73 COM4 APP_CNF_BDB_COMMISSIONING_NOTIFICATION (0x4F80)
        Status: 1 (0x1)
        Commissioning Mode: 0x01 (Network Steering) (0x1)
        Commissioning Mode: 101 (0x65)
    
    <RX>09:17:26.99 COM4 ZDO_STATE_CHANGE_IND (0x45C0)
        State: 3 (0x3)
    
    <RX>09:17:27.52 COM4 ZDO_STATE_CHANGE_IND (0x45C0)
        State: 5 (0x5)
    
    <RX>09:17:29.15 COM4 ZDO_STATE_CHANGE_IND (0x45C0)
        State: 7 (0x7)
    
    <RX>09:17:29.5 COM4 APP_CNF_BDB_COMMISSIONING_NOTIFICATION (0x4F80)
        Status: 0x00 (Success) (0x0)
        Commissioning Mode: 0x01 (Network Steering) (0x1)
        Commissioning Mode: 227 (0xE3)
    
    <TX>09:19:34.57 COM4 AF_REGISTER (0x2400)
        EndPoint: 0x01
        AppProfID: 0x0001
        AppDeviceId: 0x0001
        AppDevVer: 0x00
        LatencyReq: NO_LATENCY_REQS (0x0)
        AppNumInClusters: 0x02
        AppInClusterList: 0x0000, 0x0006
        AppNumOutClusters: 0x02
        AppOutClusterList: 0x0000, 0x0006
    
    <RX>09:19:34.58 COM4 AF_REGISTER_SRSP (0x6400)
        Status: afStatus_SUCCESS (0x0)
    

    and this is my  AF_DATA_REQUEST_EXT


  • I don't have my EVB to test this now. Why don't you use AF_DATA_REQUEST instead of AF_DATA_REQUEST_EXT?
  • i wanted to use ieee address to send data
  • Just test it and it works fine.

    <TX>02:55:50.95 COM1 AF_DATA_REQUEST_EXT (0x2402)
    DstAddrMode: 0x03 (ADDRESS_64_BIT) (0x3)
    DstAddr: >....K.. (0x3E, 0x00, 0xE5, 0x00, 0x00, 0x4B, 0x12, 0x00)
    DstEndPoint: 0x08
    DstPanId: 0x0000
    SrcEndpoint: 0x01
    ClusterID: 0x0006
    TransID: 0x01
    Options: 0x00
    Radius: 0x07
    Len: 0x0003
    Data: ... (0x01, 0x00, 0x02)

    <RX>02:55:50.96 COM1 AF_DATA_REQUEST_EXT_SRSP (0x6402)
    Status: afStatus_SUCCESS (0x0)

    <RX>02:55:51.06 COM1 AF_DATA_CONFIRM (0x4480)
    Status: afStatus_SUCCESS (0x0)
    Endpoint: 0x01
    TransID: 0x01

    <RX>02:55:51.09 COM1 AF_INCOMING_MSG (0x4481)
    GroupID: 0x0000
    ClusterID: 0x0006
    SrcAddr: 0x2F07
    SrcEndpoint: 0x08
    DstEndpoint: 0x01
    WasBroadcast: 0x00
    LinkQuality: 0x86
    SecurityUse: 0x00
    Timestamp: 0x0029DF0D
    TransSeqNumber: 0x00
    Len: 0x05
    Data: ..... (0x18, 0x00, 0x0B, 0x02, 0x00)
  • thanks allot it worked