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) 2013 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
jksoft 0:8c643bfe55b7 13 /** @file
jksoft 0:8c643bfe55b7 14 *
jksoft 0:8c643bfe55b7 15 * @defgroup ble_rpc_cmd_encoder Command Encoder
jksoft 0:8c643bfe55b7 16 * @{
jksoft 0:8c643bfe55b7 17 * @ingroup ble_sdk_lib_serialization
jksoft 0:8c643bfe55b7 18 *
jksoft 0:8c643bfe55b7 19 * @brief Encoder for serialized commands from Application Chip.
jksoft 0:8c643bfe55b7 20 *
jksoft 0:8c643bfe55b7 21 * @details This file contains the declaration of the functions that encode serialized commands
jksoft 0:8c643bfe55b7 22 * from Application Chip.
jksoft 0:8c643bfe55b7 23 */
jksoft 0:8c643bfe55b7 24
jksoft 0:8c643bfe55b7 25 #ifndef BLE_RPC_CMD_ENCODER_H__
jksoft 0:8c643bfe55b7 26 #define BLE_RPC_CMD_ENCODER_H__
jksoft 0:8c643bfe55b7 27
jksoft 0:8c643bfe55b7 28 #include <stdint.h>
jksoft 0:8c643bfe55b7 29 #include "ble_rpc_defines.h"
jksoft 0:8c643bfe55b7 30
jksoft 0:8c643bfe55b7 31 /**@brief Command response type. */
jksoft 0:8c643bfe55b7 32 typedef struct
jksoft 0:8c643bfe55b7 33 {
jksoft 0:8c643bfe55b7 34 uint8_t op_code; /**< Operation code for which this response applies. */
jksoft 0:8c643bfe55b7 35 uint32_t err_code; /**< Error code received for this response applies. */
jksoft 0:8c643bfe55b7 36 } cmd_response_t;
jksoft 0:8c643bfe55b7 37
jksoft 0:8c643bfe55b7 38 /**@brief Function for initializing the BLE S110 RPC Command Encoder module.
jksoft 0:8c643bfe55b7 39 *
jksoft 0:8c643bfe55b7 40 * @details This function uses the HCI Transport module, \ref hci_transport and executes
jksoft 0:8c643bfe55b7 41 * \ref hci_transport_tx_done_register and \ref hci_transport_tx_alloc . All errors
jksoft 0:8c643bfe55b7 42 * returned by those functions are passed on by this function.
jksoft 0:8c643bfe55b7 43 *
jksoft 0:8c643bfe55b7 44 * @retval NRF_SUCCESS Upon success
jksoft 0:8c643bfe55b7 45 * @return Errors from \ref hci_transport and \ref hci_transport_tx_alloc .
jksoft 0:8c643bfe55b7 46 */
jksoft 0:8c643bfe55b7 47 uint32_t ble_rpc_cmd_encoder_init(void);
jksoft 0:8c643bfe55b7 48
jksoft 0:8c643bfe55b7 49 /**@brief Function for blocking in a loop, using WFE to allow low power mode, while awaiting a
jksoft 0:8c643bfe55b7 50 * response from the connectivity chip.
jksoft 0:8c643bfe55b7 51 *
jksoft 0:8c643bfe55b7 52 * @param[in] op_code The Operation Code for which a response message is expected.
jksoft 0:8c643bfe55b7 53 *
jksoft 0:8c643bfe55b7 54 * @return The decoded error code received from the connectivity chip.
jksoft 0:8c643bfe55b7 55 */
jksoft 0:8c643bfe55b7 56 uint32_t ble_rpc_cmd_resp_wait(uint8_t op_code);
jksoft 0:8c643bfe55b7 57
jksoft 0:8c643bfe55b7 58 /**@brief Function for handling the command response packet.
jksoft 0:8c643bfe55b7 59 *
jksoft 0:8c643bfe55b7 60 * @details This function will be called when a command response is received in the transport
jksoft 0:8c643bfe55b7 61 * layer. The response is decoded and returned to the waiting caller.
jksoft 0:8c643bfe55b7 62 *
jksoft 0:8c643bfe55b7 63 * @param[in] p_packet The packet from the transport layer.
jksoft 0:8c643bfe55b7 64 * @param[in] packet_length The length of the packet.
jksoft 0:8c643bfe55b7 65 */
jksoft 0:8c643bfe55b7 66 void ble_rpc_cmd_rsp_pkt_received(uint8_t * p_packet, uint16_t packet_length);
jksoft 0:8c643bfe55b7 67
jksoft 0:8c643bfe55b7 68 #endif // BLE_RPC_CMD_ENCODER_H__
jksoft 0:8c643bfe55b7 69
jksoft 0:8c643bfe55b7 70 /**@} */