Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What BLE gateway APIs do you need? #9

Open
bradjc opened this issue Nov 25, 2015 · 0 comments
Open

What BLE gateway APIs do you need? #9

bradjc opened this issue Nov 25, 2015 · 0 comments

Comments

@bradjc
Copy link
Member

bradjc commented Nov 25, 2015

To guide what gateway infrastructure we need, it might be useful to start with what APIs we would like to be able to use at the application layer. These APIs would likely be the top layer in a cloudcomm-like system, where the running application offloads data to a gateway subsystem. That gateway library ("gwlib") would then likely store the data until it can offload it to a gateway, which would then forward the data on somehow. Now, there are quite a few different designs that could work here.

Some thoughts:

1. Something simple

Setup a URL at boot and then just write data. The endpoint at the given URL will get HTTP posts with the data.

void gwlib_init (char* url);
void gwlib_write (uint8_t* buf, uint32_t len);

2. More like files:

This makes gwlib also capable of storing the data. Each create() creates a "file" which can then be removed after it is offloaded or kept until delete() is called.

void gwlib_init (char* url);
int gwlib_create (uint8_t* buf, uint32_t len, bool persistent);
void gwlib_delete (int file);

3. The HTTP option

Instead of a log-type abstraction, what about an HTTP-like abstraction? This would let the app issue HTTP POSTs that, when a gateway was in contact, would be issued by the gateway, with a callback being called when the POST completed. This provides a lot more flexibility, but does change the abstraction.

void gwlib_post (char* url, uint8_t* buf, uint32_t len, post_callback_f callback);

Others?

There are many possibilities for this, and these are certainly not all of them. What would be most useful for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant