Lwip client with RTOS - tcp

I was trying to write a code for client using lwip/tcp. I had problem with tcp_connect function, error 252. Then I found out I can't use it with FreeRTOS in its usual way. Can someone provide me a hint or if there is any, example for this?
Thanks,
Ana

The lwip has 3-level API:
Callback-style API or RAW API - when you allocate pcbs, uses callbacks for events. It API isn't thread-safe and haven't used with RTOS.
netconn API - thread-safe API which should be used with RTOS (opt NO_SYS=0). Most used as I know.
socket API - thread-safe API similar to BSD-Sockets which should used with RTOS (opt NO_SYS=0).
So with FreeRTOS you should use netconn API or socket API.
Please check first https://lwip.fandom.com/wiki/Netconn_API
For examples - please check your vendor of MCU examples. If it doesn't exist - check out examples from STM32 for example https://www.st.com/resource/en/user_manual/dm00103685-developing-applications-on-stm32cube-with-lwip-tcp-ip-stack-stmicroelectronics.pdf

Related

MassTransit Check if queue and exchange exist

I'm using dotnet with masstransit rabbitmq.
I was wondering if there's a way to check if a specific exchange and queue exist. I have 2 services that connect to the same rabbitmq and are started at the same time. One services does all of the queue/exchange setup; I want the 2nd service to do while loop check to see if the queue/exchange exist before proceeding.
I was trying to look at the documentation to see if I could find some examples, but could not locate any. Could someone point me in the right direction?
Thanks.
MassTransit does not generally support this type of coupling behavior, since it ends up linking the consuming service to the producing service. There are plenty of other solutions in MassTransit to support your needs, such as sending messages directly to a queue using queue:name as the destination address.
As such, there aren't any built-in methods to check queue/exchange existence in MassTransit.

Is it possible to send realtime data from arduino to a server api?

I know how to build server api with java. Is it possible to send real time data from the arduino to my server api to save real time data.
Yes it's certainly possible however your server API must also be taken into consideration for best practices.
Typically you would use a protocol called MQTT to achieve this. It enables you to transmit data from resource constrained devices to a server, however HTTP has also been used. It really depends on the kinds of performance & reliability needs of your system.
If you're using a popular cloud platform they offer managed IOT services that provide well defined API's to do this.

Does the Qt MQTT package provide an easy way of writing my own broker?

I'm considering trying the MQTT implementation provided by Qt.
I've studied the documentation, the classes, the members of the classes, and the examples. Nowhere did I find anything indicating how to make my own broker.
All the examples, and all the classes and the available source code seem to be limited to creating a client. The examples use some online broker service to test this client.
So, does the Qt MQTT package provide an easy way of writing my own broker?
No, it is for clients. The overview pretty much says so
It enables applications to act as telemetry displays and devices to publish telemetry data.

NServiceBus IP Address

I am new to Nservicebus and have recently started working in it. I am stuck on a point and need input from you guys. I have 2 asp.net core web api projects and I want to use NServicebus to send messages between both of them in some scenarios.
What I have found so far that I can provide name to EndpointConfiguration, what if one of my api is deployed on 1 server and 2nd on another server, in that case how my configuration should be?
I tried to gave url instead of name in EndpointConfiguration but it gave me exception.
Thanks in advance for your help
NServiceBus endpoints communicate over some messaging infrastructure your system will be using. Endpoint names represent queues messages sent to. Messaging infrastructure is abstracted by what NServiceBus is calling a Transport. You will need to decide on the transport you'd like to use (see the options here). Once you've decided what transport your solution will use, you could have a look at the samples for that specific transports to have an idea how to set up your endpoints.
For example, if you'll decide to use Azure Service Bus as your transport, you could download and try the Send/Reply sample.
A good starting point could be the tutorials available on the documentation site here.

BlueZ 5.30: D-Bus GATT API - Simply Discover and Connect to a BLE device in C

With the last release of BlueZ (5.30) the highlight was the completion of the GATT D-Bus apis. My goal is to programmatically (in C), as a BLE client:
scan for ble devices (which I can do with the hci layer)
Connect to an advertising BLE device
Get the UUIDs
Execute Read and Write to handles
The BlueZ community is strongly suggesting to use the GATT-Dbus api to accomplish this. After multiple searches and head scratching I was not successful to find a proper way or example that would perform this through GATT-DBUs api. It seems more complicate than just use directly the GATT layer. Unfortunately BlueZ removed direct access to make calls to gatt.
I'm very close to just pull the GATT source files out from Bluez, compile it as it's own independent library and directly use the GATT layer and calls to connect and execute reads/writes to ble device server. I know it is not the suggested way compared to the DBUS-GATT api but I'm out of options.
If anybody has any input on this or suggestion (with some sample code) please advise.
thank you in advance!
The best way to start with DBUS GATT API is to hace a look at the source code here: http://git.kernel.org/cgit/bluetooth/bluez.git/tree/
Under client folder you can find a full sample of how to use the DBUS GATT API. Actually that is the source of bluetoothctl tool.
Note that DBUS GATT API is still experimental but you can enable it running bluetoothd service with -E flag.
I had a similar issue which is to interact with a BLE device with a GATT C/C++ API.
In my case I had to use Bluez v4.101 - the latest Bluez version available in Ubuntu 14.04 LTS (read my story). In Bluez v4.x, there is no DBus API.
And actually, I have recently worked with Bluez v5 DBus API and I discovered if you do not use at least Bluez v5.39 (from April 2016) it is likely you will have issue with the DBus API. And as said before the DBus API is still experimental.
So to solve my Bluez v4.x dependency I had to pull the GATT source files out from Bluez and create my own library 'gattlib'. The project is Open-Source to encourage feedback and contribution.
I am using this library in my own GATT client project.
I wrote few examples to help people to start using it see the folder /examples of the project.
EDIT March 2017: I have just added DBus support to gattlib (https://github.com/labapart/gattlib/). From Bluez v5.42, gattlib automatically uses DBus API (DBus gattlib backend can also be forced when building the library to use it before v5.42).

Resources