![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
主導機 mbed用のプログラムです 改良しました
Dependencies: mbed
Fork of F3RC_syudou_master by
Diff: hci.cpp
- Revision:
- 8:6d0de6154e8f
- Parent:
- 0:736c76a75def
--- a/hci.cpp Thu Apr 30 06:26:22 2015 +0000 +++ b/hci.cpp Fri May 15 02:45:57 2015 +0000 @@ -28,6 +28,7 @@ #include <stdlib.h> #include <stdio.h> #include <string.h> +#include <mbed.h> #include "Utils.h" #include "hci.h" @@ -68,6 +69,7 @@ } void printf(const BD_ADDR* addr); +void fprintf(FILE *fp,const BD_ADDR* addr); BTDevice* HCI::Find(const BD_ADDR* addr) { @@ -170,14 +172,19 @@ // Init phase 2 case HCI_OP_READ_BD_ADDR: + { + LocalFileSystem local("local"); + FILE *fp; + fp = fopen("/local/data.p3b", "w"); _localAddr = *((BD_ADDR*)data); // Local Address printf("Local Address: "); printf(&_localAddr); + fprintf(fp,&_localAddr); + fclose(fp); printf("\r\n"); - _state |= MASK_READ_BD_ADDR; _state |= MASK_INITED; - Callback(CALLBACK_READY,data,6); + Callback(CALLBACK_READY,data,6);}; break; // 0CXX