Sming
Sming copied to clipboard
AtClient sample
Hello, is some sample for ATClient ? I did not find .
There is no AtClient sample but you are free to add one. From other projects I can give you the following code (incomplete and without any warranty) samples
void a6Callback(AtClient& client, Stream& source, char arrivedChar,
uint16_t availableCharsCount)
{
// Do something useful here...
}
void a20_example()
{
AtClient modem(&Serial);
modem.send("ATE0");
modem.send("AT+CAMSTART");
modem.send(
"AT+CAMCAP\r", "+CAMCAP:",
(AtCallback)([&](AtClient& client, Stream& source, char arrivedChar,
uint16_t availableCharsCount) {
printf("Ch: 0x%x, Av: %d\n", arrivedChar, availableCharsCount);
}),
NULL, 4000);
AtCommand command;
command.name = "AT+CAMRD\r";
command.breakOnError = false;
command.callback = a6Callback;
modem.send(command);
// ...
}
I have a PhotoBooth project which is gathering dust for quite some time. When I find the time I can try to revive it and add it here as a sample or as an application based on Sming Framework,
@slaff BTW your code is not Sming, because AtCommand struct has not fields callback and name ...
Just check the code inside https://github.com/SmingHub/Sming/blob/6af154606a66361f999bc37549c9993e2dec0174/Sming/SmingCore/AtClient.cpp#L78 .
I guess my example code is too old. As I said - no warranty :)
@slaff The world has not any warranty! I try to modify code, but looks like my modem neoway 590 is die. I need to get new one ....