TeleViLibに対応するMSC
Dependencies: BLE_API mbed nRF51822
Fork of nRF51822_SimpleChat_LED_kai by
Diff: main.cpp
- Revision:
- 9:37c7b2a4b0a5
- Parent:
- 8:0d98c9aca74c
--- a/main.cpp Wed Jan 18 05:33:13 2017 +0000 +++ b/main.cpp Sun Feb 12 10:28:39 2017 +0000 @@ -31,16 +31,14 @@ #include "TxPower.h" //#include "DFUService.h" -LocalFileSystem local("local"); // マウントポイントを定義(ディレクトリパスになる) - #define BLE_UUID_TXRX_SERVICE 0x0000 /**< The UUID of the Nordic UART Service. */ #define BLE_UUID_TX_CHARACTERISTIC 0x0003 /**< The UUID of the TX Characteristic. */ #define BLE_UUIDS_RX_CHARACTERISTIC 0x0002 /**< The UUID of the RX Characteristic. */ #define TXRX_BUF_LEN 20 -//#define DIGITAL_OUT_PIN P0_17 //nRF51, 51822 -#define DIGITAL_OUT_PIN P0_5 //Nano +#define DIGITAL_OUT_PIN P0_17 //nRF51, 51822 +//#define DIGITAL_OUT_PIN P0_5 //Nano // TX POWER用 #include "ble_gap.h" #define TX_POWER 0 @@ -49,12 +47,15 @@ //#define TX_POWER_CALI -10 //const static char DEVICE_NAME[] = "nRF51DK"; // change this -#define TX_POWER_CALI -7 -const static char DEVICE_NAME[] = "51822"; // change this +//#define TX_POWER_CALI -7 +//const static char DEVICE_NAME[] = "51822"; // change this //#define TX_POWER_CALI -15 //const static char DEVICE_NAME[] = "Nano"; // change this +#define TX_POWER_CALI -10 +const static char DEVICE_NAME[] = "MN2"; // change this + //反映してない 二箇所設定変更する場所ある //static int tx_power = TX_POWER + TX_POWER_CALI; @@ -165,6 +166,7 @@ // if(led1 == 0) { led1 = 1; ledori1 = 0; + // } else { // led1 = 0; // } @@ -204,7 +206,7 @@ //ここから------------- char bufbuf_c[20]; uint8_t bufbuf[40]; - sprintf(bufbuf_c, "%s", "00000001"); + sprintf(bufbuf_c, "%s", "00000010"); //sprintf(bufbuf_c, "%d", "02f3f538-8d11-4802-b6fc-fb6616d4cd70"); int a; for(a=0; bufbuf_c[a] != '\0'; a++) { @@ -221,7 +223,7 @@ //ここから------------- char bufbuf_c[20]; uint8_t bufbuf[40]; - sprintf(bufbuf_c, "%s", "Mn.Out.Led"); + sprintf(bufbuf_c, "%s", "Out.TV"); int a; for(a=0; bufbuf_c[a] != '\0'; a++) { bufbuf[a] = bufbuf_c[a]; @@ -287,20 +289,6 @@ pc.attach( uartCB , pc.RxIrq); - - FILE *fp; - FILE *fpr; - char ch[40]; - - fp = fopen("/local/out.txt", "w"); // ファイルを書き込みモードで開く - fprintf(fp, "Hello World!"); - fclose(fp); - - fpr = fopen("/local/out.txt", "r"); - fscanf(fp, "%s", ch); - pc.printf("%s\r\n",ch); - - //txPowerService = new TxPowerService(ble, -40); //txPowerService->updateTxPower(TX_POWER);