BLE demo for mbed Ported RunningElectronics's SBDBT firmware for BLE. It can communicate with iOS

Dependencies:   FatFileSystem mbed

Fork of BTstack by Norimasa Okamoto

Committer:
todotani
Date:
Wed Feb 20 14:18:38 2013 +0000
Revision:
6:cf06ba884429
Parent:
1:6078e430af82
Change tick timer to 1ms. Change attribute 0xFFF1 as read of DigitalIn p5

Who changed what in which revision?

UserRevisionLine numberNew contents of line
va009039 0:1ed23ab1345f 1 /*
va009039 0:1ed23ab1345f 2 * Copyright (C) 2009-2012 by Matthias Ringwald
va009039 0:1ed23ab1345f 3 *
va009039 0:1ed23ab1345f 4 * Redistribution and use in source and binary forms, with or without
va009039 0:1ed23ab1345f 5 * modification, are permitted provided that the following conditions
va009039 0:1ed23ab1345f 6 * are met:
va009039 0:1ed23ab1345f 7 *
va009039 0:1ed23ab1345f 8 * 1. Redistributions of source code must retain the above copyright
va009039 0:1ed23ab1345f 9 * notice, this list of conditions and the following disclaimer.
va009039 0:1ed23ab1345f 10 * 2. Redistributions in binary form must reproduce the above copyright
va009039 0:1ed23ab1345f 11 * notice, this list of conditions and the following disclaimer in the
va009039 0:1ed23ab1345f 12 * documentation and/or other materials provided with the distribution.
va009039 0:1ed23ab1345f 13 * 3. Neither the name of the copyright holders nor the names of
va009039 0:1ed23ab1345f 14 * contributors may be used to endorse or promote products derived
va009039 0:1ed23ab1345f 15 * from this software without specific prior written permission.
va009039 0:1ed23ab1345f 16 * 4. Any redistribution, use, or modification is done solely for
va009039 0:1ed23ab1345f 17 * personal benefit and not for any commercial purpose or for
va009039 0:1ed23ab1345f 18 * monetary gain.
va009039 0:1ed23ab1345f 19 *
va009039 0:1ed23ab1345f 20 * THIS SOFTWARE IS PROVIDED BY MATTHIAS RINGWALD AND CONTRIBUTORS
va009039 0:1ed23ab1345f 21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
va009039 0:1ed23ab1345f 22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
va009039 0:1ed23ab1345f 23 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MATTHIAS
va009039 0:1ed23ab1345f 24 * RINGWALD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
va009039 0:1ed23ab1345f 25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
va009039 0:1ed23ab1345f 26 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
va009039 0:1ed23ab1345f 27 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
va009039 0:1ed23ab1345f 28 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
va009039 0:1ed23ab1345f 29 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
va009039 0:1ed23ab1345f 30 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
va009039 0:1ed23ab1345f 31 * SUCH DAMAGE.
va009039 0:1ed23ab1345f 32 *
va009039 0:1ed23ab1345f 33 * Please inquire about commercial licensing options at btstack@ringwald.ch
va009039 0:1ed23ab1345f 34 *
va009039 0:1ed23ab1345f 35 */
va009039 0:1ed23ab1345f 36
va009039 0:1ed23ab1345f 37 /*
va009039 0:1ed23ab1345f 38 * run_loop_private.h
va009039 0:1ed23ab1345f 39 *
va009039 0:1ed23ab1345f 40 * Created by Matthias Ringwald on 6/6/09.
va009039 0:1ed23ab1345f 41 */
va009039 0:1ed23ab1345f 42
va009039 0:1ed23ab1345f 43 #pragma once
va009039 0:1ed23ab1345f 44
todotani 1:6078e430af82 45 #include "btstack/run_loop.h"
va009039 0:1ed23ab1345f 46
va009039 0:1ed23ab1345f 47 #ifdef HAVE_TIME
va009039 0:1ed23ab1345f 48 #include <sys/time.h>
va009039 0:1ed23ab1345f 49
va009039 0:1ed23ab1345f 50 // compare timeval or timers - NULL is assumed to be before the Big Bang
va009039 0:1ed23ab1345f 51 int run_loop_timeval_compare(struct timeval *a, struct timeval *b);
va009039 0:1ed23ab1345f 52 int run_loop_timer_compare(timer_source_t *a, timer_source_t *b);
va009039 0:1ed23ab1345f 53
va009039 0:1ed23ab1345f 54 #endif
va009039 0:1ed23ab1345f 55
va009039 0:1ed23ab1345f 56 //
va009039 0:1ed23ab1345f 57 void run_loop_timer_dump(void);
va009039 0:1ed23ab1345f 58
va009039 0:1ed23ab1345f 59 // internal use only
va009039 0:1ed23ab1345f 60 typedef struct {
todotani 1:6078e430af82 61 void (*init)(void);
todotani 1:6078e430af82 62 void (*add_data_source)(data_source_t *dataSource);
todotani 1:6078e430af82 63 int (*remove_data_source)(data_source_t *dataSource);
todotani 1:6078e430af82 64 void (*add_timer)(timer_source_t *timer);
todotani 1:6078e430af82 65 int (*remove_timer)(timer_source_t *timer);
todotani 1:6078e430af82 66 void (*execute)(void);
todotani 1:6078e430af82 67 void (*dump_timer)(void);
va009039 0:1ed23ab1345f 68 } run_loop_t;