HTD MC-66 Multi-Zone Controller
From LinuxMCE
Revision as of 00:39, 16 April 2012 by Dh (Talk | contribs) (Created page with "Sold by Home Theater Direct (http://www.htdirect.com). Provides matrix switching 6 input: 6 ouput == Example Control Code provided by manufacturer == Example of C Code writte...")
Sold by Home Theater Direct (http://www.htdirect.com).
Provides matrix switching 6 input: 6 ouput
Example Control Code provided by manufacturer
Example of C Code written to turn the Volume Up in one Zone of the MCA66 Controller through the RS232 Serial Port This particular example was written for use in a Lantronix Network-to-RS232 Controller, but it should still be helpful. Note: Although this was written to send commands to the MC66 & MCA66 Controllers, aside from specific differences in the calls, it should also be useful in understanding how to write a similar C program for the Lync systems.
void sendVolUpToHW(BYTE zoneNum) { sendCMD_0x04(zoneNum, 0x09); }
void sendCMD_0x04(BYTE zoneNum, BYTE data) { BYTE cmd[6]; cmd[0] = 0x02; cmd[1] = 0x00; cmd[2] = zoneNum + 1; // hardware is one-based index cmd[3] = 0x04; cmd[4] = data; cmd[5] = cmd[0]+cmd[1]+cmd[2]+cmd[3]+cmd[4]; serialSend(0, cmd, 6); nice(); }
static int serialSend(int chan, BYTE *buf, int len) { TCB save; CCB *saveCCB; BYTE *ptr; int i; /* Save the current associated stream */ memcpy(&save, ActPro, sizeof(TCB)); saveCCB = ActCCB; /* Set to new channel and send data */ ActPro->CCB_Ptr = &AllCCB[chan]; ActPro->Chan_Nr = chan; ActPro->IO_Ptr = AllCCB[chan].IOPtrs; ActCCB = &AllCCB[chan]; FlushIn(); sendblk(buf, len); /* Restore old stream */ memcpy(ActPro, &save, sizeof(TCB)); ActCCB = saveCCB; return(len); }