L0_BlueNRG_Test_Client

Dependencies:   BLE_API BLE_BlueNRG mbed

Fork of L0_BlueNRG_Test by Mridupawan Das

Committer:
mridup
Date:
Mon Jul 14 14:18:53 2014 +0000
Revision:
0:e0204b0e5541
Child:
1:3b1c20952274
Nucleo L0 btle Library working set v0.1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mridup 0:e0204b0e5541 1 #include "mbed.h"
mridup 0:e0204b0e5541 2
mridup 0:e0204b0e5541 3 DigitalOut myled(LED1);
mridup 0:e0204b0e5541 4
mridup 0:e0204b0e5541 5 #ifdef __cplusplus
mridup 0:e0204b0e5541 6 extern "C" {
mridup 0:e0204b0e5541 7 #endif
mridup 0:e0204b0e5541 8
mridup 0:e0204b0e5541 9 #include "stm32l0xx_bluenrg_shield_bsp.h"
mridup 0:e0204b0e5541 10 #include "hci.h"
mridup 0:e0204b0e5541 11 #include "bluenrg_hci.h"
mridup 0:e0204b0e5541 12 #include "hci_internal.h"
mridup 0:e0204b0e5541 13 #include "bluenrg_hci_internal.h"
mridup 0:e0204b0e5541 14
mridup 0:e0204b0e5541 15 #include <stdio.h>
mridup 0:e0204b0e5541 16 #include <string.h>
mridup 0:e0204b0e5541 17
mridup 0:e0204b0e5541 18 #ifdef __cplusplus
mridup 0:e0204b0e5541 19 }
mridup 0:e0204b0e5541 20 #endif
mridup 0:e0204b0e5541 21
mridup 0:e0204b0e5541 22 #include "btle.h"
mridup 0:e0204b0e5541 23
mridup 0:e0204b0e5541 24 int main() {
mridup 0:e0204b0e5541 25
mridup 0:e0204b0e5541 26 btle_init(); //Init the BlueNRG Shield
mridup 0:e0204b0e5541 27
mridup 0:e0204b0e5541 28 while(1) {
mridup 0:e0204b0e5541 29 myled = 1; // LED is ON
mridup 0:e0204b0e5541 30 wait(0.5); // 500 ms
mridup 0:e0204b0e5541 31 myled = 0; // LED is OFF
mridup 0:e0204b0e5541 32 wait(0.5); // 500 ms
mridup 0:e0204b0e5541 33
mridup 0:e0204b0e5541 34 HCI_Process();
mridup 0:e0204b0e5541 35 User_Process();//Start Advertising
mridup 0:e0204b0e5541 36 }
mridup 0:e0204b0e5541 37 }
mridup 0:e0204b0e5541 38