Ignore:
Timestamp:
Apr 5, 2019, 9:26:53 PM (5 years ago)
Author:
coas-nagasima
Message:

mbed関連を更新
シリアルドライバをmbedのHALを使うよう変更
ファイルディスクリプタの処理を更新

File:
1 edited

Legend:

Unmodified
Added
Removed
  • asp3_tinet_ecnl_arm/trunk/btstack/src/sdp_client.c

    r352 r374  
    151151static void parse_service_search_attribute_response(uint8_t* packet){
    152152    uint16_t offset = 3;
    153     uint16_t parameterLength = READ_NET_16(packet,offset);
     153    uint16_t parameterLength = big_endian_read_16(packet,offset);
    154154    uint16_t attributeListByteCount;
    155155    offset+=2;
    156156    // AttributeListByteCount <= mtu
    157     attributeListByteCount = READ_NET_16(packet,offset);
     157    attributeListByteCount = big_endian_read_16(packet,offset);
    158158    offset+=2;
    159159
     
    185185    // uint16_t handle;
    186186    if (packet_type == L2CAP_DATA_PACKET){
    187         uint16_t responseTransactionID = READ_NET_16(packet,1);
     187        uint16_t responseTransactionID = big_endian_read_16(packet,1);
    188188        if ( responseTransactionID != transactionID){
    189189            log_error("Missmatching transaction ID, expected %u, found %u.", transactionID, responseTransactionID);
     
    247247            }
    248248            sdp_cid = channel;
    249             mtu = READ_BT_16(packet, 17);
    250             // handle = READ_BT_16(packet, 9);
     249            mtu = little_endian_read_16(packet, 17);
     250            // handle = little_endian_read_16(packet, 9);
    251251            log_info("SDP Client Connected, cid %x, mtu %u.", sdp_cid, mtu);
    252252
     
    261261        case L2CAP_EVENT_CHANNEL_CLOSED: {
    262262            uint8_t status;
    263             if (sdp_cid != READ_BT_16(packet, 2)) {
    264                 // log_info("Received L2CAP_EVENT_CHANNEL_CLOSED for cid %x, current cid %x\n",  READ_BT_16(packet, 2),sdp_cid);
     263            if (sdp_cid != little_endian_read_16(packet, 2)) {
     264                // log_info("Received L2CAP_EVENT_CHANNEL_CLOSED for cid %x, current cid %x\n",  little_endian_read_16(packet, 2),sdp_cid);
    265265                break;
    266266            }
     
    402402static void parse_service_search_response(uint8_t* packet){
    403403    uint16_t offset = 3;
    404     uint16_t parameterLength = READ_NET_16(packet,offset);
     404    uint16_t parameterLength = big_endian_read_16(packet,offset);
    405405    uint16_t totalServiceRecordCount;
    406406    uint16_t currentServiceRecordCount;
    407407    offset+=2;
    408408
    409     totalServiceRecordCount = READ_NET_16(packet,offset);
    410     offset+=2;
    411 
    412     currentServiceRecordCount = READ_NET_16(packet,offset);
     409    totalServiceRecordCount = big_endian_read_16(packet,offset);
     410    offset+=2;
     411
     412    currentServiceRecordCount = big_endian_read_16(packet,offset);
    413413    offset+=2;
    414414    if (currentServiceRecordCount > totalServiceRecordCount){
     
    436436static void parse_service_attribute_response(uint8_t* packet){
    437437    uint16_t offset = 3;
    438     uint16_t parameterLength = READ_NET_16(packet,offset);
     438    uint16_t parameterLength = big_endian_read_16(packet,offset);
    439439        uint16_t attributeListByteCount;
    440440    offset+=2;
    441441
    442442    // AttributeListByteCount <= mtu
    443     attributeListByteCount = READ_NET_16(packet,offset);
     443    attributeListByteCount = big_endian_read_16(packet,offset);
    444444    offset+=2;
    445445
Note: See TracChangeset for help on using the changeset viewer.