Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] Embedded MQTT C Client

Thanks.

Probably a newbie-stupid question: under ../MQTTClient/src/arduino i only
see header (.h) files, there are no implementation (.cpp) files, I suppose
the .h files use the implementation/libraries provided by the Spark Core,
is that correct?


Of course i meant: 
...there are no implementation (.cpp) files, I suppose
the .h files use the implementation/libraries provided by Arduino,
is that correct? So I need to find the corresponding Spark Core libraries?


Thanks.
Guy


On 24/09/14 11:19, "Al Stockdill-Mander" <asm@xxxxxxxx> wrote:

>The C++ .h files for the arduino files include implementation for a
>specific platform, you'll also need all the files from MQTTClient/src
>(although MQTTClient.h imports FP and MQTTLogging) as well. But the
>WifiIPStack.h is for the arduino Wifi shield only, I don't think it will
>work with the Spark Core, but you should use it as a basis to create,
>for example, SparkTCPClient.h. In WifiIPStack.h you can see there is a
>private WifiClient, the Spark version looks to be TCPClient, your class
>also needs to implement the read() and write() functions. I'm afraid I
>don't have one of these devices to do any direct dev myself.
>
>Thanks.
>
>Al
>
>On 24/09/14 09:47, Guy Dillen wrote:
>> Hi All,
>>
>> I just started trying to port the MQTTClient to Spark Core. As you
>> mentioned in previous post I should try with the Arduino embedded C++
>> library.
>> So I suppose I need to import the header files under
>> ../MQTTClient/src/arduino Countdown.h, and WifiPStack.h (not
>> EthernetStack.h since Spark Core hasn’t ethernet=LAN) on-board and all
>> source code under ../MQTTPacket/src/ except the ones (used by servers)
>> mentioned by Ian: QTTUnsubscribeServer.c, MQTTSubscribeServer.c and
>> MQTTConnectServer.c?
>>
>> Probably a newbie-stupid question: under ../MQTTClient/src/arduino i
>>only
>> see header (.h) files, there are no implementation (.cpp) files, I
>>suppose
>> the .h files use the implementation/libraries provided by the Spark
>>Core,
>> is that correct?
>>
>> Thanks.
>> Guy
>>
>>
>> On 23/09/14 15:31, "Guy Dillen" <guy.dillen@xxxxxxxxx> wrote:
>>
>>> Al thanks. i¹ll give it a try.
>>>
>>> On 22/09/14 18:05, "Al Stockdill-Mander" <asm@xxxxxxxx> wrote:
>>>
>>>> The CC3200 code relies on the SimpleLink libraries provided by TI. I'm
>>>> not familiar with the Spark Core but it looks like it's designed to be
>>>> similar to the arduino in terms of IDE and libraries. It will almost
>>>> certainly be easier to port the arduino embedded C++ library. If you
>>>> look in the repo at the moment under arduino there is EthernetStack.h
>>>> and WifiIPStack.h, these provide the implementation specifics for the
>>>> Ethernet or WifiShield on an arduino.
>>>> Looking at the Spark site there seem to be most of the equivalent
>>>> functions (.connect() .available() .write()) under TCPClient, although
>>>> it doesn't seem to have a readBytes() so you'd have to use a loop to
>>>> read() a byte at a time into the buffer.
>>>> The current Countdown.h in the arduino directory should work as is as
>>>>it
>>>> only uses millis() which also seems to be on the spark core.
>>>>
>>>> Al
>>>>
>>>> On 22/09/14 16:44, Guy Dillen wrote:
>>>>> Hi Al,
>>>>>
>>>>> Thanks.
>>>>> Besides the TI CC3200 I also would like porting/using the library
>>>>>with
>>>>> my Spark Core's (www.spark.io) based on that are based on the ARM
>>>>>cortex
>>>>> M3 microprocessor. I suppose, since I'm no expert C developer, can I
>>>>>use
>>>>> the same source code as for the CC3200? Any help/suggestions welcome.
>>>>>
>>>>> Thanks.
>>>>> Guy
>>>>>
>>>>> Sent from my iPad
>>>>>
>>>>>> On 22 Sep 2014, at 17:13, Al Stockdill-Mander <asm@xxxxxxxx> wrote:
>>>>>>
>>>>>> Guy,
>>>>>>
>>>>>> Copy the MQTTClient.c/h and MQTTCC3200.c/h files to wherever is
>>>>>> suitable for the app you're working on. You only need to import the
>>>>>> MQTTClient.h, but you have to edit MQTTClient.h to #include the
>>>>>> platform specific implementation it is to use. Currently there is
>>>>>>only
>>>>>> the CC3200 code, so add a #import "MQTTCC3200.h" to the end of the
>>>>>> #includes in MQTTClient.h
>>>>>> I realise that there is a distinct lack of documentation/samples for
>>>>>> the C specific embedded client, I'll try and get something up asap.
>>>>>>In
>>>>>> the mean time please ask any other questions here and I'll do what I
>>>>>> can to help.
>>>>>>
>>>>>> Al
>>>>>>
>>>>>>> On 22/09/14 14:56, Guy Dillen wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> I mentioned the embedded C implementation has a specific C (and
>>>>>>>even
>>>>>>> more specific) CC3200 implementation.
>>>>>>> I¹m confused as what sources to use; in the example form Benjamin
>>>>>>> Cabé
>>>>>>> all source code under MQTTPacket was imported in the CC3200
>>>>>>> microcontroller project. Should I still import these sources or
>>>>>>>only
>>>>>>> the
>>>>>>> sources under
>>>>>>> org.eclipse.paho.mqtt.embedded-c-master -> MQTTClient-C -> cc3200
>>>>>>>->
>>>>>>> MQTTCC3200.c and MQTTCC3200.h?
>>>>>>>
>>>>>>> Thanks.
>>>>>>> Guy
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> paho-dev mailing list
>>>>>>> paho-dev@xxxxxxxxxxx
>>>>>>> To change your delivery options, retrieve your password, or
>>>>>>> unsubscribe from this list, visit
>>>>>>> https://dev.eclipse.org/mailman/listinfo/paho-dev
>>>>>> _______________________________________________
>>>>>> paho-dev mailing list
>>>>>> paho-dev@xxxxxxxxxxx
>>>>>> To change your delivery options, retrieve your password, or
>>>>>> unsubscribe from this list, visit
>>>>>> https://dev.eclipse.org/mailman/listinfo/paho-dev
>>>>> _______________________________________________
>>>>> paho-dev mailing list
>>>>> paho-dev@xxxxxxxxxxx
>>>>> To change your delivery options, retrieve your password, or
>>>>>unsubscribe
>>>> >from this list, visit
>>>>> https://dev.eclipse.org/mailman/listinfo/paho-dev
>>>>>
>>>> _______________________________________________
>>>> paho-dev mailing list
>>>> paho-dev@xxxxxxxxxxx
>>>> To change your delivery options, retrieve your password, or
>>>>unsubscribe
>>> >from this list, visit
>>>> https://dev.eclipse.org/mailman/listinfo/paho-dev
>>>
>>>
>>
>>
>> _______________________________________________
>> paho-dev mailing list
>> paho-dev@xxxxxxxxxxx
>> To change your delivery options, retrieve your password, or unsubscribe
>>from this list, visit
>> https://dev.eclipse.org/mailman/listinfo/paho-dev
>>
>_______________________________________________
>paho-dev mailing list
>paho-dev@xxxxxxxxxxx
>To change your delivery options, retrieve your password, or unsubscribe
>from this list, visit
>https://dev.eclipse.org/mailman/listinfo/paho-dev




Back to the top