Vincullum -II Host Controller IC を使用して、USB プリンター (Brother HL-1111 シリーズ プリンター) に接続しようとしています。コントローラーの USB ポート経由でプリンターを列挙できますが、 PCL5 コマンドまたは任意のテキストを Printer に送信すると、何も印刷できません。
以下の API を使用してテキストをプリンターに送信します。
// devCaps1 contains some String
if (vos_dev_write(hPrinter,(unsigned char *)devCaps1 , 10 , NULL) == USBHOSTPRINTER_OK)
{
//Print this status to serial terminal
message("Check Printer Output\r\n");
}
以下の API を使用してプリンターにコマンドを送信します。
//Esc(3@ or (27)(40)(51)(64)[Decimal] or <1Bh><28h><33h><40h>[Hex] For selecting default Font
//uint8 vos_dev_write(VOS_HANDLE h,uint8 *buf,uint16 num_to_write,uint16 *num_written);
//h - is for handle
vos_dev_write(hPrinter,(char) 27 , 1 , NULL);
vos_dev_write(hPrinter,(char) 40 , 1 , NULL);
vos_dev_write(hPrinter,(char) 51 , 1 , NULL);
vos_dev_write(hPrinter,(char) 64 , 1 , NULL);
それで、USB経由でコマンドを実行するように案内してください。
私は正しい道を進んでいますか、それとも間違った道を進んでいますか?