Go Down

Topic: Problems stitching a few pieces of code together. (Read 5710 times) previous topic - next topic

bubulindo

I suppose casting it won't work either.

I still think this behavior is strange. Can you open the virtual wire library and see if they use some compiler directive there that will screw this up? Also, if you're up to it, change all references from uint8_t to char or unsigned char and save the library.

There's nothing else I can think of really. :S
This... is a hobby.

Jack_Strop

Quote
if you're up to it, change all references from uint8_t to char or unsigned char and save the library


I was thinking of doing something like this. Would this mean that I wouldn't have to coerce any data types in my sketch?  I'm not too confident in what I'm doing but if I screw something up, I could just download the library again.

Thank you for your help and patience.

bubulindo


Quote
if you're up to it, change all references from uint8_t to char or unsigned char and save the library


I was thinking of doing something like this. Would this mean that I wouldn't have to coerce any data types in my sketch?  I'm not too confident in what I'm doing but if I screw something up, I could just download the library again.

Thank you for your help and patience.


You can save a copy of your library beforehand.
Then open the library files in a text editor (not the Arduino IDE), and look for the uint8_t and change them. I normally use the Find + Replace function to be sure I take out all of them.
This... is a hobby.

AWOL

Can I just confirm that you're still talking about these two functions:
Code: [Select]
int postToTwitter(char * buf)
and
Code: [Select]
extern uint8_t vw_get_message(uint8_t* buf, uint8_t* len);?

and that you've got
Code: [Select]
uint8_t buf[VW_MAX_MESSAGE_LEN];
uint8_t buflen = VW_MAX_MESSAGE_LEN;
declared?
and you want to do something like
Code: [Select]
if (vw_get_message(buf, &buflen-1)) {
  (void)postToTwitter ((char*)buf);
}

?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Jack_Strop

Everything looks correct except for:
Code: [Select]
extern uint8_t vw_get_message(uint8_t* buf, uint8_t* len);

I don't remember using this in anything previously. Thanks for having another look.

bubulindo


and you want to do something like
Code: [Select]
if (vw_get_message(buf, &buflen-1)) {
  (void)postToTwitter ((char*)buf);
}

?



In the words of Homer Simpson: "DOOOOOOOOOOOHHHHHHHHHHHH". LOL
This... is a hobby.

AWOL

Quote
Everything looks correct except for:
Code:

extern uint8_t vw_get_message(uint8_t* buf, uint8_t* len);

That's the prototype in the header file.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy