Example sketches also for group subscription and group publishing also updated.
Version bumped for release
Explanation:
The comparison if (strcmp(cur_cb->feed, d->feedName()) == 0 || cur_cb->feed == NULL{ fails due to the callback attempting to obtain the feed's name (cur_cb->feed) because the _groupCallback callback was never properly init'd since the setup() in adafruitio_11_group_pub.ino never calls onMessage, which is used to initialize the _groupCallback (https://github.com/adafruit/Adafruit_IO_Arduino/blob/master/src/AdafruitIO_Group.cpp#L309).
The _groupCallback is never NULL, so the check within onMessage which initializes _groupCallback also fails. This is why the subscribe example fails in the same part of the code, while it properly sets up the message handler.
Tested on Adafruit Feather HUZZAH32
examples/adafruitio_12_group_sub/adafruitio_12_group_sub.ino
Connecting to Adafruit IO
..
Adafruit IO connected.
received example.count-1 <- 3
received example.count-2 <- 4
received example.count-1 <- test!
received example.count-2 <- Test two!
Fixes crash on group subscription and publishing:
https://github.com/adafruit/Adafruit_IO_Arduino/issues/114
https://github.com/adafruit/Adafruit_IO_Arduino/issues/111
Example sketches also for group subscription and group publishing also updated.
Version bumped for release
Explanation: The comparison
if (strcmp(cur_cb->feed, d->feedName()) == 0 || cur_cb->feed == NULL{
fails due to the callback attempting to obtain the feed's name (cur_cb->feed
) because the_groupCallback
callback was never properly init'd since thesetup()
inadafruitio_11_group_pub.ino
never calls onMessage, which is used to initialize the_groupCallback
(https://github.com/adafruit/Adafruit_IO_Arduino/blob/master/src/AdafruitIO_Group.cpp#L309).The
_groupCallback
is neverNULL
, so the check withinonMessage
which initializes_groupCallback
also fails. This is why the subscribe example fails in the same part of the code, while it properly sets up the message handler.Tested on Adafruit Feather HUZZAH32 examples/adafruitio_12_group_sub/adafruitio_12_group_sub.ino
examples/adafruitio_11_group_pub/adafruitio_11_group_pub.ino