Arduino IridiumSBD Library for ChipKIT

Post Reply
Digisol
Posts: 2
Joined: Sat Aug 13, 2016 8:54 pm

Arduino IridiumSBD Library for ChipKIT

Post by Digisol » Sat Aug 13, 2016 10:01 pm

Hello everybody.
my first post on your forum.
There is an Arduino library for IridiumSBD modem at http://arduiniana.org/libraries/iridiumsbd/
I need to use it on ChipKIT uC32 board.
Lots of compile time errors.
Any hints?
Many thanks!

User avatar
majenko
Site Admin
Posts: 2164
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: Arduino IridiumSBD Library for ChipKIT

Post by majenko » Sun Aug 14, 2016 12:14 am

That library relies on the Arduino's Harvard architecture to store and retrieve strings from flash. Something the chipKIT never needs to do. It includes a set of hacks that force certain overloads that completely break on the chipKIT boards. It's not possible to change the chipKIT end of things because those overloads would then conflict with other overloads. It's all a bit of a mess really.

To fix the library you would need to go through and either delete any functions that use FlashString or replace FlashString with "const char *" - you can't just change the typedef or you run into the same problem - collisions with overloads of functions that take "const char *" already.

So:

* If there is a pair of overloaded functions with FlashString and "const char *" then delete the FlashString version
* If there is no overloaded equivalent of a FlashString function then change it to "const char *".
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

User avatar
majenko
Site Admin
Posts: 2164
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: Arduino IridiumSBD Library for ChipKIT

Post by majenko » Sun Aug 14, 2016 12:18 am

Oh, and on top of that they have written it so it will only work on an 8-bit CPU by mixing and matching "size_t" and "uint16_t" at will. On a 32 bit system "size_t" is "uint32_t" not "uint16_t" - so more overloading will have to be added to compensate.
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

User avatar
majenko
Site Admin
Posts: 2164
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: Arduino IridiumSBD Library for ChipKIT

Post by majenko » Sun Aug 14, 2016 12:20 am

Ok, here is a sanitized version that at least compiles. I can't tell if it works or not of course.
Attachments
IridiumSBD.zip
(47.79 KiB) Downloaded 31 times
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

Digisol
Posts: 2
Joined: Sat Aug 13, 2016 8:54 pm

Re: Arduino IridiumSBD Library for ChipKIT

Post by Digisol » Mon Aug 15, 2016 8:09 pm

Dear Majenko.
I want you to know how much I appreciate the time dedicated to help people like me with limited programming skills.
Your help is greatly appreciated. :D :D
Thanks again for a very fast response!
Have a nice day!.

Post Reply