iOSのBLEコントローラアプリ「RCBController」とmbed HRM1017を接続し、RCサーボモータを操作するテストプログラムです。

Dependencies:   BLE_API_Native_IRC Servo mbed

Fork of BLE_RCBController by Junichi Katsu

  • 古いBLEライブラリを使っているのでプラットフォームは”Nordic nRF51822”を選択してください。
  • ライブラリ類はUpdateしないでください。コンパイルエラーになります。

うまく接続できない時は、iPhone/iPadのBluetoothをOFF->ONしてキャッシュをクリアしてみてください。

/media/uploads/robo8080/img_1560.jpg

Committer:
jksoft
Date:
Thu Jul 10 14:21:52 2014 +0000
Revision:
0:8c643bfe55b7
??

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jksoft 0:8c643bfe55b7 1 /* Copyright (c) 2011 Nordic Semiconductor. All Rights Reserved.
jksoft 0:8c643bfe55b7 2 *
jksoft 0:8c643bfe55b7 3 * The information contained herein is property of Nordic Semiconductor ASA.
jksoft 0:8c643bfe55b7 4 * Terms and conditions of usage are described in detail in NORDIC
jksoft 0:8c643bfe55b7 5 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
jksoft 0:8c643bfe55b7 6 *
jksoft 0:8c643bfe55b7 7 * Licensees are granted free, non-transferable use of the information. NO
jksoft 0:8c643bfe55b7 8 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
jksoft 0:8c643bfe55b7 9 * the file.
jksoft 0:8c643bfe55b7 10 */
jksoft 0:8c643bfe55b7 11
jksoft 0:8c643bfe55b7 12 /* Attention!
jksoft 0:8c643bfe55b7 13 * To maintain compliance with Nordic Semiconductor ASA�s Bluetooth profile
jksoft 0:8c643bfe55b7 14 * qualification listings, this section of source code must not be modified.
jksoft 0:8c643bfe55b7 15 */
jksoft 0:8c643bfe55b7 16
jksoft 0:8c643bfe55b7 17 /** @file
jksoft 0:8c643bfe55b7 18 * @brief Contains definition of ble_date_time structure.
jksoft 0:8c643bfe55b7 19 */
jksoft 0:8c643bfe55b7 20
jksoft 0:8c643bfe55b7 21 /** @file
jksoft 0:8c643bfe55b7 22 *
jksoft 0:8c643bfe55b7 23 * @defgroup ble_sdk_srv_date_time BLE Date Time characteristic type
jksoft 0:8c643bfe55b7 24 * @{
jksoft 0:8c643bfe55b7 25 * @ingroup ble_sdk_srv
jksoft 0:8c643bfe55b7 26 * @brief Definition of ble_date_time_t type.
jksoft 0:8c643bfe55b7 27 */
jksoft 0:8c643bfe55b7 28
jksoft 0:8c643bfe55b7 29 #ifndef BLE_DATE_TIME_H__
jksoft 0:8c643bfe55b7 30 #define BLE_DATE_TIME_H__
jksoft 0:8c643bfe55b7 31
jksoft 0:8c643bfe55b7 32 #include <stdint.h>
jksoft 0:8c643bfe55b7 33 #include "nordic_global.h"
jksoft 0:8c643bfe55b7 34
jksoft 0:8c643bfe55b7 35 /**@brief Date and Time structure. */
jksoft 0:8c643bfe55b7 36 typedef struct
jksoft 0:8c643bfe55b7 37 {
jksoft 0:8c643bfe55b7 38 uint16_t year;
jksoft 0:8c643bfe55b7 39 uint8_t month;
jksoft 0:8c643bfe55b7 40 uint8_t day;
jksoft 0:8c643bfe55b7 41 uint8_t hours;
jksoft 0:8c643bfe55b7 42 uint8_t minutes;
jksoft 0:8c643bfe55b7 43 uint8_t seconds;
jksoft 0:8c643bfe55b7 44 } ble_date_time_t;
jksoft 0:8c643bfe55b7 45
jksoft 0:8c643bfe55b7 46 static __INLINE uint8_t ble_date_time_encode(const ble_date_time_t * p_date_time,
jksoft 0:8c643bfe55b7 47 uint8_t * p_encoded_data)
jksoft 0:8c643bfe55b7 48 {
jksoft 0:8c643bfe55b7 49 uint8_t len = uint16_encode(p_date_time->year, p_encoded_data);
jksoft 0:8c643bfe55b7 50
jksoft 0:8c643bfe55b7 51 p_encoded_data[len++] = p_date_time->month;
jksoft 0:8c643bfe55b7 52 p_encoded_data[len++] = p_date_time->day;
jksoft 0:8c643bfe55b7 53 p_encoded_data[len++] = p_date_time->hours;
jksoft 0:8c643bfe55b7 54 p_encoded_data[len++] = p_date_time->minutes;
jksoft 0:8c643bfe55b7 55 p_encoded_data[len++] = p_date_time->seconds;
jksoft 0:8c643bfe55b7 56
jksoft 0:8c643bfe55b7 57 return len;
jksoft 0:8c643bfe55b7 58 }
jksoft 0:8c643bfe55b7 59
jksoft 0:8c643bfe55b7 60 static __INLINE uint8_t ble_date_time_decode(ble_date_time_t * p_date_time,
jksoft 0:8c643bfe55b7 61 const uint8_t * p_encoded_data)
jksoft 0:8c643bfe55b7 62 {
jksoft 0:8c643bfe55b7 63 uint8_t len = sizeof(uint16_t);
jksoft 0:8c643bfe55b7 64
jksoft 0:8c643bfe55b7 65 p_date_time->year = uint16_decode(p_encoded_data);
jksoft 0:8c643bfe55b7 66 p_date_time->month = p_encoded_data[len++];
jksoft 0:8c643bfe55b7 67 p_date_time->day = p_encoded_data[len++];
jksoft 0:8c643bfe55b7 68 p_date_time->hours = p_encoded_data[len++];
jksoft 0:8c643bfe55b7 69 p_date_time->minutes = p_encoded_data[len++];
jksoft 0:8c643bfe55b7 70 p_date_time->seconds = p_encoded_data[len++];
jksoft 0:8c643bfe55b7 71
jksoft 0:8c643bfe55b7 72 return len;
jksoft 0:8c643bfe55b7 73 }
jksoft 0:8c643bfe55b7 74
jksoft 0:8c643bfe55b7 75 #endif // BLE_DATE_TIME_H__
jksoft 0:8c643bfe55b7 76
jksoft 0:8c643bfe55b7 77 /** @} */