Thanks Thomas, I changed it a bit and it's in cvs now. Let me know if it works for you. I have it working with a serial LCD display from WinXp but haven't tried with linux yet. I also found a [print( message for comport that wasn't documented before. It will send a symbol as ascii. And someone else has added a [hupcl( message as well that doesn't work on Windows at all, so I moved it to the unix part.
Martin
Thomas O Fredericks wrote:
Hi Martin, I modified my local copy of comport to work with lists and it solved all problems.
I sooo don't know how to code in C, but this is what I added to make it work with lists:
//Added for LIST processing static void comport_list(t_comport *x, t_symbol *s, int argc, t_atom *argv) {
unsigned char temp_array[argc]; int i; for(i = 0; i < argc; i++) { temp_array[i] = ((unsigned char) atom_getint(argv + i)) & 0xFF; // post ("Data: %d", temp_array[i]); } int result = write(x->comhandle,(char *) &temp_array[0],argc); if (result < 0) post ("[comport] write returned %d, errno is %d", result, errno); //return result;
} //Added end
Tom
On 10/11/07, Martin Peach martin.peach@sympatico.ca wrote:
Thomas O Fredericks wrote:
Hi Martin,
just to make sure, the newest version of comport is in iem/comport/comport right?
Yep.
"But the result should be the same, the data gets sent anyway, the error is bogus."
Nope, the data is never received by the device.
OK, I'll look into it. I guess comport should have a way of sending lists of bytes as well.
Martin
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list