Comments (2)
Hi @yangchi, sorry for not responding earlier.
(1) The sockets API for now only includes UDP sockets, because the first use case for the framework was to enable secure CoAP transactions, and CoAP is transported over UDP. I do have a work in progress to add TCP sockets to the API (the underlying IP stack supports it), I'm hoping to have a PR for that soon.
(2) That's right. The GATT MTU is transparent to the upper layers, the UDP packets will get properly split into smaller payloads (that's one of the features of the so-called Gattlink protocol that we layer between the IP stack and GATT). We also don't enable IP fragmentation in the IP stack (to keep buffers at a minimum), so you do need to limit the UDP datagrams to something that fits in a single IP packet. The default IP MTU we configure is 1280, but that can be changed at runtime via the API.
(3) The NIP stack is very limited in what it supports. It doesn't enforce any runtime-changeable MTU. There's a fixed compile-time limit (GG_NIP_MAX_PACKET_SIZE
) set currently at 0xFFFF. So as long as there's enough memory, it will allow you to send large datagrams. But large datagrams would likely be rejected by the next layer down, because the default size for the Gattlink ring buffer is, by default, set at 2 times the IP MTU (by default, that's configurable at runtime), so if you have datagrams that don't fit in the Gattlink buffer, they'll be rejected.
(4) On macOS and iOS, the default sockets are still LwIP sockets (BSD sockets are still enabled, but you need to ask for the specifically), because those are the ones that get routed to the Bluetooth layer. BSD sockets go through the host OS's native IP stack, so you can go over WiFi or LTE. Unfortunately, we can't connect the Bluetooth/gattlink network interface to the OS's native IP stack, because doing so would require to use an IP tunnel, which on iOS and Android require the app to act as a VPN, which isn't something practical for most apps. In the macOS build of the stack tool, however, there's an option to bridge packets to the tun/tap network interface, so as to communicate through the macOS native IP stack, but that's mostly for experimentation and debugging.
(5) All the C APIs are available on all platforms. On Android, we expose some of them, indirectly, via JNI and some Kotlin classes. But if you're willing to write your own JNI code, you can make calls into any of the C APIs. On iOS, there's no need for JNI, as the Apple tools create a Swift/C bridge automatically, but the concept is the same.
from golden-gate.
Hi @barbibulle : Thank you so much for such detailed reply! You cleared all my questions. This is so awesome.
from golden-gate.
Related Issues (16)
- Golden Gate & Project Connected Home over IP HOT 4
- Zephyr and WebAssembly roadmap HOT 5
- Feasibility to use it in long-lived connections HOT 2
- What is the expected code size for a full featured GG Stack? HOT 2
- Permissioning of NSBluetoothAlwaysUsageDescription for Stack Tool HOT 3
- Support for HTTP/TLS/TCP HOT 4
- Windows and Android Studio - issue with libgg.so and libxp.so HOT 4
- Is it possible to increase the speed and throughput? HOT 2
- CoAP/DTLS and X.509? HOT 1
- Exception when using example Android App HOT 8
- Zephyr RTOS - Documentation HOT 2
- Th
- Cortex-M4 Code Migrating HOT 2
- Problem building the project - CMAKE HOT 2
- Program to sync Fitbit device on Windows PC
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from golden-gate.