Example #1
0
int main(){

	char *device = (char *)"/dev/ttyUSB0";

	Serial xbee(device, 57600);
	Message msg(device);

	int fd = xbee.Open();

	std::cout << "Send Image signal\n";
	msg.sendingImage();

	std::cout << "Transmitting Image\n";
	int result = XSend(fd, "testing9.jpeg");

	if(result == 0){
		std::cout << "Image transmitted successfully\n";
	}
	else{
		std::cout << "Error during image transmission\n";
	}

	xbee.Close();
	return 0;
}
Example #2
0
int hdr_write (int s)
{
    int i;

    XSend (s, "%3u ", reply.resp);

    Send (s, reply.response == NULL ? "" : reply.response);
    Send (s, "\n");

    for (i=0; i<reply.nhdr; i++)
    {
        Send (s, reply.hdrlines[i]);
        Send (s, "\n");
    }
    Send (s, "\n");

    return 0;
}