Zoilo Gomez schreef:
Hi Michel,No, my gotox program is using an API and the API is using the Mantis driver to send out the DiseqC message. I also have another program which does not use the API but talks directly to the Mantis driver. It talks to the /dev/dvb/adapter0/frontend0 device with ioctl calls. The following is an example: int TDVBSDevice::SendRotorMoveCommand(float angle) { int ret = 0; struct dvb_diseqc_master_cmd diseqc_message; int integer = (int) angle; uint8_t data[] = { 0xE0, 0x31, 0x6e, 0x00, 0x00}; // transform the fraction into the correct representation int fraction = (int) (((angle - integer) * 16.0) + 0.9) & 0x0f; switch(fraction) { case 1: case 4: case 7: case 9: case 12: case 15: fraction--; break; } // generate the command if (integer < 0.0) { data[3] = 0xD0; // West is a negative angle value } else if (integer >= 0.0) { data[3] = 0xE0; // East is a positive angle value } integer = abs(integer); data[3] |= ((integer / 16) & 0x0f); integer = integer % 16; data[4] |= ((integer & 0x0f) << 4) | fraction; diseqc_message.msg_len = 5; memcpy(diseqc_message.msg, data, 5); ret = ioctl(vfrontendfd, FE_DISEQC_SEND_MASTER_CMD, &diseqc_message); if (ret == -1) syslog(LOG_ERR, "rotor_goto_bearing: IOCTL failed"); else ret = 0; return ret; } I really use the Mantis driver and as you can see I specify the complete DiseqC command, see uint8_t data[] = { 0xE0, 0x31, 0x6e, 0x00, 0x00};, to send not the driver. The example above is the same as used by the API internally. Michel Z. |
_______________________________________________ linux-dvb mailing list linux-dvb@xxxxxxxxxxx http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb