Authentication service with the feature value of the micro-channels on the CC2541 AirSync



In doing CC2541 micro letter on time, with the best AirSyncDebugger software, this software only Android version Download: http://iot.weixin.qq.com/download.html ; all relevant information can be downloaded here, which has a Demo program is based on the Nordic nRF51822 platform.  

AirSyncDebugger verified when crossing, the first two steps in front of speaking, where said third step. The third step is to verify the services and features of value . wechatIOTAttrTbl [] procedure is as follows:

static gattAttribute_t wechatIOTAttrTbl[] =  
{  
    // wechatIOT Service  
    {  
        { ATT_BT_UUID_SIZE, primaryServiceUUID } ,  /* type */  
        GATT_PERMIT_READ ,                          /* permissions */  
        0 ,                                         /* handle */  
        (uint8 *)&wechatService                     /* pValue */  
    } ,  
    //////////////////////////////////////////////  
    // Indicate  
    //////////////////////////////////////////////  
    // 1. Characteristic Declaration  
    {  
        { ATT_BT_UUID_SIZE, characterUUID },  
        GATT_PERMIT_READ,  
        0,  
        &wechatIndicateProps  
    },  
    // 2. Characteristic Value  
    {  
        { ATT_BT_UUID_SIZE, wechatIndicateUUID },  
        0, //return READ_NOT_PERMITTED  
        0,  
        &wechatIndicate  
    },  
    // 3.Characteristic Configuration  
    {  
        { ATT_BT_UUID_SIZE, clientCharCfgUUID },  
        GATT_PERMIT_READ | GATT_PERMIT_WRITE,  
        0,  
        (uint8 *)&wechatIndicateConfig  
    },  
    //////////////////////////////////////////////  
    // Write  
    //////////////////////////////////////////////  
    // 4.Characteristic Declaration  
    {  
        { ATT_BT_UUID_SIZE, characterUUID },  
        GATT_PERMIT_READ,  
        0,  
        &wechatWriteProps  
    },  
    // 5.Characteristic Value  
    {  
        { ATT_BT_UUID_SIZE, wechatWriteUUID },  
        GATT_PERMIT_READ | GATT_PERMIT_WRITE,  
        0,  
        &wechatWrite[0]  
    },  
    //////////////////////////////////////////////  
    // Read  
    //////////////////////////////////////////////  
    // 6.Characteristic Declaration  
    {  
        { ATT_BT_UUID_SIZE, characterUUID },  
        GATT_PERMIT_READ,  
        0,  
        &wecharReadProps  
    },  
    // 7.Characteristic Value  
    {  
        { ATT_BT_UUID_SIZE, wecharReadUUID },  
        GATT_PERMIT_READ ,  
        0 ,  
        &ownAddress[0]  
    } ,  

} ;  


This is the key part of the micro channel BLE devices connected to the here only to the correct connection and data exchange. Of course, there are other places to write, not the focus, it is no longer here to write.

If you are not familiar with this one, then understand it is quite troublesome, and I also do first Bluetooth more than a year, all the important places CCC2541 are familiar too, it is easy to program in a fancy micro letter, but the back of the packet certification of the program it is very difficult to understand, because there is no contact.

Published 38 original articles · won praise 10 · Views 100,000 +

Guess you like

Origin blog.csdn.net/winux123/article/details/52244338