strlen() returns the length of zero-terminated C strings. Perhaps sizeof()
would work better.
Steve
> From: mohamed rafi <email@hidden>
> Date: Wed, 16 Feb 2005 15:52:05 -0800 (PST)
> To: <email@hidden>
> Subject: Request not getting sent to Device.
>
> Hi,
>
> I have a Serial Device, which I have connected to my
> Mac through a Keyspan. I am trying to do Baud
> Synchronisation of the device, before sending
> commands/requests to it. I am using C to do the same.
>
> Following is the piece of code I am using for that:
>
> DEVICENAME = "/dev/tty.USA19H1b1P1.1"
> fd = open(DEVICENAME, O_RDWR | O_NONBLOCK);
> ..
> unsigned char baudArray[] =
> {0x01,0x00,0x96,0x00,0x02,0x95,0x4d,0x54,0x19};
>
> k = write(fd, baudArray, strlen(baudArray));
>
> How do I ensure that it gets transmitted to the
> device, and how can I get the output from the device
> for this ?
>
> Thanks,
> Rafi SM
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Usb mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/usb/email@hidden
This email sent to email@hidden