FTDI Communication with USB device - Objective C

后端 未结 2 981
[愿得一人]
[愿得一人] 2020-12-15 00:57

I\'m trying to communicate with the Enttec USB DMX Pro. Mainly receiving DMX.

They released a Visual C++ version here, but I\'m a little stumped on what to do to con

2条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-15 01:17

    I was running into a similar issue (trying to write to the EntTec Open DMX using Objective-C), without any success. After following @Brad's great answer, I realized that you also need to toggle the BREAK state each time you send a DMX packet.

    Here's an example of my loop in some testing code that sends packets with a 20 millisecond delay between frames.

    while (1) {
    
        FT_SetBreakOn(usbRelayPointer);
        FT_SetBreakOff(usbRelayPointer);
    
        ftdiPortStatus = FT_Write(usbRelayPointer, startCode, 1, &bytesWrittenOrRead);
        ftdiPortStatus = FT_Write(usbRelayPointer, dataBuffer, (DWORD)[command length], &bytesWrittenOrRead);
        usleep(20000);
    }
    

    Hope this helps someone else out there!

提交回复
热议问题