{"id":614,"date":"2014-02-25T16:20:22","date_gmt":"2014-02-25T07:20:22","guid":{"rendered":"http:\/\/www.gvc-on.net\/?page_id=614"},"modified":"2014-02-25T16:21:24","modified_gmt":"2014-02-25T07:21:24","slug":"%e3%83%98%e3%83%83%e3%83%80%e3%83%95%e3%82%a1%e3%82%a4%e3%83%abgvcd-h","status":"publish","type":"page","link":"http:\/\/www.gvc-on.net\/?page_id=614","title":{"rendered":"\u30d8\u30c3\u30c0\u30d5\u30a1\u30a4\u30eb(gvcd.h)"},"content":{"rendered":"<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n\/\/ --------------------------------------------------\r\n\/\/ Global Versatile Controler http:\/\/www.gvc-on.net\/\r\n\/\/ --------------------------------------------------\r\n\/\/ --------------------------------------------------\r\n\/\/ Revision Memo (Y.M.D Editor\/Memo)\r\n\/\/ --------------------------------------------------\r\n\/\/\r\n\/\/ 2013.06.10 T.Kabu\r\n\/\/ \u6c4e\u7528\u5236\u5fa1\u88c5\u7f6e Grobal Versatile Controller Daemon (gvcd)\r\n\/\/\r\n\/\/ gvcd \/dev\/????? (GVC\u304c\u63a5\u7d9a\u3055\u308c\u3066\u3044\u308b\u30c7\u30d0\u30a4\u30b9\u540d)\r\n\/\/\r\n\/\/ \u30c7\u30d0\u30a4\u30b9\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306f9600N81\r\n\/\/   9600bps\r\n\/\/   \u30ce\u30f3\u30d1\u30ea\u30c6\u30a3\r\n\/\/   8\u30d3\u30c3\u30c8\r\n\/\/   \u30b9\u30c8\u30c3\u30d7\u30d3\u30c3\u30c81\r\n\/\/   \u30d5\u30ed\u30fc\u5236\u5fa1\u306fArduino\u3067\u306f\u3057\u3066\u3044\u306a\u3044\u306e\u3067OFF\r\n\/\/\r\n\/\/ \u30d1\u30e9\u30e1\u30fc\u30bf\u306fsetserial\u306a\u3069\u306e\u5916\u90e8\u30b3\u30de\u30f3\u30c9\u3067\u8a2d\u5b9a\u3059\u308c\u3070\u3044\u3044\u3068\u304a\u3082\u3046\r\n\/\/\r\n\/\/ \u53c2\u8003URL\u3044\u308d\u3044\u308d\r\n\/\/ http:\/\/pinka99.ddo.jp\/nanao\/work\/daemon.html\r\n\/\/ http:\/\/d.hatena.ne.jp\/rero\/20041002\/p1\r\n\/\/ http:\/\/linuxmag.sourceforge.jp\/Japanese\/March2003\/article287.shtml\r\n\/\/ http:\/\/www.geocities.co.jp\/Athlete-Samos\/7760\/study\/msgkyu1.html\r\n\/\/ http:\/\/www.geocities.jp\/taka_owl2005\/job\/UNIX\/kernel\/ipc.html\r\n\/\/ http:\/\/d.hatena.ne.jp\/ka2yan\/20090327\r\n\/\/\r\n\/\/ ------------------------------\r\n\/\/ BASE\r\n\/\/ ------------------------------\r\n\/\/ 2011.11.02 T.Kabu gvcd\t\t\t\t\u3068\u308a\u3042\u3048\u305a\u53d6\u308a\u639b\u304b\u308b\r\n\/\/ 2011.12.01 T.Kabu gvcd2c\t\t\t\t\u5e7e\u3064\u304b\u306e\u30bb\u30f3\u30b5\u30fc\u306b\u5bfe\u5fdc\u3057\u3066\u753b\u9762\u306b\u5410\u304d\u51fa\u3059\u3088\u3046\u306b\u3057\u305f\r\n\/\/ 2011.12.20 T.Kabu gvcd3\t\t\t\t\u30c7\u30fc\u30e2\u30f3\u5316\u3001\u30d7\u30ed\u30bb\u30b9\u30c1\u30a7\u30c3\u30af\u3001\u30ed\u30b0\u5410\u304d\u51fa\u3057\u306b\u53d6\u308a\u639b\u304b\u308b\r\n\/\/ 2012.02.02 T.Kabu gvcd3b\t\t\t\t\u30c6\u30b9\u30c8\u30bd\u30fc\u30b9\u304b\u3089\u3042\u308c\u3053\u308c\u30de\u30fc\u30b8\u3001\u30d7\u30ed\u30bb\u30b9\u9593\u901a\u4fe1(\u30e1\u30c3\u30bb\u30fc\u30b8\u30ad\u30e5\u30fc)\u5bfe\u5fdc\r\n\/\/ 2012.02.06 T.Kabu gvcd3c\t\t\t\tGVC\u306b\u5bfe\u3057\u3066\u30b3\u30de\u30f3\u30c9\u9001\u4fe1\r\n\/\/ 2012.03.09 T.Kabu gvcd4\t\t\t\t\u30b9\u30bf\u30fc\u30c8\u30d5\u30ec\u30fc\u30e0\u3068\u8a00\u3046\u5b9a\u7fa9\u3092\u3084\u3081\u3066\u3001\u30c7\u30ea\u30df\u30bf\u30e1\u30c3\u30bb\u30fc\u30b8\u306b\u3057\u305f\r\n\/\/ 2013.06.10 T.Kabu gvcd_20130610\t\tRev.2\u7528\u306b\u8272\u3005\u4fee\u6b63\r\n\/\/ \t\t\t\t\t\t\t\t\t\t\u4ee5\u5f8c\u3001\u65e5\u4ed8\u3067\u9010\u6b21\u30ea\u30d3\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u3057\u3066\u3044\u304f\u4e8b\u306b\u3059\u308b\r\n\/\/ 2013.07.18 T.Kabu gvcd_20130717\t\t\u8d64\u5916\u7dda\u30c7\u30fc\u30bf(\u3064\u307e\u308a\u30ea\u30e2\u30b3\u30f3)\u306e\u9001\u53d7\u4fe1\u4fdd\u5b58\u518d\u9001\u304c\u51fa\u6765\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u306e\u3067\u3044\u3063\u305f\u3093Fix\r\n\/\/ 2013.12.20 T.Kabu \t\t\t\t\t\u6e05\u66f8\u3068\u3001\u8d64\u5916\u7dda\u30c7\u30fc\u30bf\u306e\u30b5\u30a4\u30ba\u306e\u95a2\u4fc2\u3067\u6271\u3048\u308b\u30c7\u30fc\u30bf\u30b5\u30a4\u30ba\u3092\u30d8\u30c3\u30c0\u8fbc\u307f\u3067\u6700\u59271600\u30d0\u30a4\u30c8\u306b\u7d71\u4e00\u3059\u308b\r\n\r\n\/\/---------------------------------------------------\r\n\/\/ include\r\n\/\/---------------------------------------------------\r\n\r\n\/\/ --------------------------------------------------\r\n\/\/ Const Define\r\n\/\/ --------------------------------------------------\r\n#define\t\tSOFTNAME\t\t\t\t&quot;Gloval Versatile Controler(GVC) Daemon&quot;\r\n#define\t\tVERSION\t\t\t\t\t&quot;201312&quot;\r\n\r\n#define\t\tBAUD_RATE\t\t\t\tB9600\t\t\/\/ \u30b7\u30ea\u30a2\u30eb\u30dd\u30fc\u30c8\u30dc\u30fc\u30ec\u30fc\u30c8\r\n\t\t\t\t\t\t\t\t\t\t\t\t\/\/ PIC\u306f\u305d\u306e\u30af\u30ed\u30c3\u30af\u306b\u3082\u3088\u308a\u307e\u3059\u304c\u3001B9600\uff5e\u306b\u306a\u308a\u307e\u3059\r\n\t\t\t\t\t\t\t\t\t\t\t\t\/\/ \u3061\u306a\u307f\u306bArduino\u306fLinux\u7684\u306bB300,B1200,B2400,B4800,B9600,B19200,B38400,B57600,B115200\u306b\u5bfe\u5fdc\u3067\u3057\u305f\r\n\r\n#define\t\tBUFF_SIZE\t\t\t\t4096\t\t\/\/ \u3067\u304b\u304f\u3059\u308b\u3068\u3001\u30e1\u30c3\u30bb\u30fc\u30b8\u30ad\u30e5\u30fc\u306e\u30b5\u30a4\u30ba\u3092\u8d85\u3048\u3066\u3057\u307e\u3046\u306e\u3067\u6ce8\u610f!!\r\n\t\t\t\t\t\t\t\t\t\t\t\t\/\/ 2013.12.20 \u8d64\u5916\u7dda\u30c7\u30fc\u30bf\u306e\u95a2\u4fc2\u3067\u5b9f\u969b\u306b\u6271\u3048\u308b\u30c7\u30fc\u30bf\u30b5\u30a4\u30ba\u306f\u30d8\u30c3\u30c0\u8fbc\u307f\u3067\u6700\u59271600\u30d0\u30a4\u30c8\u3068\u3059\u308b\r\n\r\n#define\t\tGVC_MIN_MESSAGE_LENGTH\t7\t\t\t\/\/ \u30b7\u30ea\u30a2\u30eb\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u6700\u5c0f\u30b5\u30a4\u30ba\r\n#define\t\tDELIMITER_LENGTH\t\t16\t\t\t\/\/ \u30c7\u30ea\u30df\u30bf\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u9577\u3055\r\n\r\n#define\t\tDAYTIME_LEN\t\t\t\t32\t\t\t\/\/ \u65e5\u6642\u60c5\u5831\u6587\u5b57\u5217\u306e\u9577\u3055\r\n\r\n#define\t\tGVC_MSG_DELIMITER\t\t0xaa\t\t\/\/ GVC\u30c7\u30ea\u30df\u30bf\u30e1\u30c3\u30bb\u30fc\u30b8(0xaa)\r\n\r\n#define\t\tGVC_MSG_END\t\t\t\t0x00\t\t\/\/ Message delimiter(Rev.2\u3067\u306f\u4f7f\u7528\u3057\u3066\u3044\u306a\u3044)\r\n\r\n\/\/ \u30e1\u30c3\u30bb\u30fc\u30b8\u30bf\u30a4\u30d7\r\n#define GVC_CMD_REQUEST_VERSION\t\t0x01\t\t\/\/ \u30d0\u30fc\u30b8\u30e7\u30f3\u8981\u6c42\u30b3\u30de\u30f3\u30c9\r\n#define GVC_CMD_REQUEST_MODULEINFO\t0x02\t\t\/\/ \u63a5\u7d9a\u30e2\u30b8\u30e5\u30fc\u30eb\u60c5\u5831\u8981\u6c42\u30b3\u30de\u30f3\u30c9\r\n#define GVC_CMD_REQUEST_MODULEDATA\t0x03\t\t\/\/ \u30e2\u30b8\u30e5\u30fc\u30eb\u30c7\u30fc\u30bf\u53d6\u5f97\u8981\u6c42\u30b3\u30de\u30f3\u30c9\r\n#define GVC_MSG_0x04\t\t\t\t0x04\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_ENQ\t\t\t\t\t0x05\t\t\/\/ GVC\u3078\u306e\u5404\u7a2e\u8981\u6c42\r\n#define GVC_MSG_0x06\t\t\t\t0x06\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x07\t\t\t\t0x07\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x08\t\t\t\t0x08\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x09\t\t\t\t0x09\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x0a\t\t\t\t0x0a\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x0b\t\t\t\t0x0b\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x0c\t\t\t\t0x0c\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x0d\t\t\t\t0x0d\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x0e\t\t\t\t0x0e\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x0f\t\t\t\t0x0f\t\t\/\/ xxx (TBD)\r\n\r\n#define GVC_MSG_0x10\t\t\t\t0x10\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x11\t\t\t\t0x11\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x12\t\t\t\t0x12\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x13\t\t\t\t0x13\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x14\t\t\t\t0x14\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x15\t\t\t\t0x15\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x16\t\t\t\t0x16\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x17\t\t\t\t0x17\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x18\t\t\t\t0x18\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x19\t\t\t\t0x19\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x1a\t\t\t\t0x1a\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x1b\t\t\t\t0x1b\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x1c\t\t\t\t0x1c\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x1d\t\t\t\t0x1d\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x1e\t\t\t\t0x1e\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x1f\t\t\t\t0x1f\t\t\/\/ xxx (TBD)\r\n\r\n#define GVC_MSG_0x20\t\t\t\t0x20\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_OTHER\t\t\t\t0x21\t\t\/\/ \u5404\u7a2e\u60c5\u5831\u30e1\u30c3\u30bb\u30fc\u30b8\r\n#define GVC_MSG_0x22\t\t\t\t0x22\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x23\t\t\t\t0x23\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x24\t\t\t\t0x24\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x25\t\t\t\t0x25\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x26\t\t\t\t0x26\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x27\t\t\t\t0x27\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x28\t\t\t\t0x28\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x29\t\t\t\t0x29\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x2a\t\t\t\t0x2a\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x2b\t\t\t\t0x2b\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x2c\t\t\t\t0x2c\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x2d\t\t\t\t0x2d\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x2e\t\t\t\t0x2e\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x2f\t\t\t\t0x2f\t\t\/\/ xxx (TBD)\r\n\r\n#define GVC_MSG_0x30\t\t\t\t0x30\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x31\t\t\t\t0x31\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x32\t\t\t\t0x32\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x33\t\t\t\t0x33\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x34\t\t\t\t0x34\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x35\t\t\t\t0x35\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x36\t\t\t\t0x36\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x37\t\t\t\t0x37\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x38\t\t\t\t0x38\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x39\t\t\t\t0x39\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x3a\t\t\t\t0x3a\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x3b\t\t\t\t0x3b\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x3c\t\t\t\t0x3c\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x3d\t\t\t\t0x3d\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x3e\t\t\t\t0x3e\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x3f\t\t\t\t0x3f\t\t\/\/ xxx (TBD)\r\n\r\n#define GVC_MSG_0x40\t\t\t\t0x40\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x41\t\t\t\t0x41\t\t\/\/ 'A' Acceleration (TBD)\r\n#define GVC_MSG_0x42\t\t\t\t0x42\t\t\/\/ 'B' xxx (TBD)\r\n#define GVC_MSG_0x43\t\t\t\t0x43\t\t\/\/ 'C' Compass (TBD)\r\n#define GVC_MSG_DIST\t\t\t\t0x44\t\t\/\/ 'D' Distance (TBD)\r\n#define GVC_MSG_0x45\t\t\t\t0x45\t\t\/\/ 'E' xxx (TBD)\r\n#define GVC_MSG_0x46\t\t\t\t0x46\t\t\/\/ 'F' xxx (TBD)\r\n#define GVC_MSG_0x47\t\t\t\t0x47\t\t\/\/ 'G' Gyro (TBD)\r\n#define GVC_MSG_HUMI\t\t\t\t0x48\t\t\/\/ 'H' Humidity (TBD)\r\n#define GVC_MSG_IR\t\t\t\t\t0x49\t\t\/\/ 'I' Infrared (TBD)\r\n#define GVC_MSG_0x4a\t\t\t\t0x4a\t\t\/\/ 'J' xxx (TBD)\r\n#define GVC_MSG_0x4b\t\t\t\t0x4b\t\t\/\/ 'K' xxx (TBD)\r\n#define GVC_MSG_LIGHT\t\t\t\t0x4c\t\t\/\/ 'L' LIGHT (TBD)\r\n#define GVC_MSG_0x4d\t\t\t\t0x4d\t\t\/\/ 'M' xxx (TBD)\r\n#define GVC_MSG_0x4e\t\t\t\t0x4e\t\t\/\/ 'N' xxx (TBD)\r\n#define GVC_MSG_0x4f\t\t\t\t0x4f\t\t\/\/ 'O' xxx (TBD)\r\n\r\n#define GVC_MSG_PRESS\t\t\t\t0x50\t\t\/\/ 'P' Pressure (TBD)\r\n#define GVC_MSG_0x51\t\t\t\t0x51\t\t\/\/ 'Q' xxx (TBD)\r\n#define GVC_MSG_0x52\t\t\t\t0x52\t\t\/\/ 'R' xxx (TBD)\r\n#define GVC_MSG_0x53\t\t\t\t0x53\t\t\/\/ 'S' xxx (TBD)\r\n#define GVC_MSG_TEMP\t\t\t\t0x54\t\t\/\/ 'T' Templeture (TBD)\r\n#define GVC_MSG_0x55\t\t\t\t0x55\t\t\/\/ 'U' xxx (TBD)\r\n#define GVC_MSG_0x56\t\t\t\t0x56\t\t\/\/ 'V' xxx (TBD)\r\n#define GVC_MSG_0x57\t\t\t\t0x57\t\t\/\/ 'W' xxx (TBD)\r\n#define GVC_MSG_0x58\t\t\t\t0x58\t\t\/\/ 'X' xxx (TBD)\r\n#define GVC_MSG_0x59\t\t\t\t0x59\t\t\/\/ 'Y' xxx (TBD)\r\n#define GVC_MSG_0x5a\t\t\t\t0x5a\t\t\/\/ 'Z' xxx (TBD)\r\n#define GVC_MSG_0x5b\t\t\t\t0x5b\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x5c\t\t\t\t0x5c\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x5d\t\t\t\t0x5d\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x5e\t\t\t\t0x5e\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x5f\t\t\t\t0x5f\t\t\/\/ xxx (TBD)\r\n\r\n#define GVC_MSG_0x60\t\t\t\t0x60\t\t\/\/ 'a' xxx (TBD)\r\n#define GVC_MSG_0x61\t\t\t\t0x61\t\t\/\/ 'b' xxx (TBD)\r\n#define GVC_MSG_0x62\t\t\t\t0x62\t\t\/\/ 'c' xxx (TBD)\r\n#define GVC_MSG_0x63\t\t\t\t0x63\t\t\/\/ 'd' xxx (TBD)\r\n#define GVC_MSG_0x64\t\t\t\t0x64\t\t\/\/ 'e' xxx (TBD)\r\n#define GVC_MSG_0x65\t\t\t\t0x65\t\t\/\/ 'f' xxx (TBD)\r\n#define GVC_MSG_0x66\t\t\t\t0x66\t\t\/\/ 'g' xxx (TBD)\r\n#define GVC_MSG_0x67\t\t\t\t0x67\t\t\/\/ 'h' xxx (TBD)\r\n#define GVC_MSG_0x68\t\t\t\t0x68\t\t\/\/ 'X' xxx (TBD)\r\n#define GVC_MSG_0x69\t\t\t\t0x69\t\t\/\/ 'i' xxx (TBD)\r\n#define GVC_MSG_0x6a\t\t\t\t0x6a\t\t\/\/ 'j' xxx (TBD)\r\n#define GVC_MSG_0x6b\t\t\t\t0x6b\t\t\/\/ 'k' xxx (TBD)\r\n#define GVC_MSG_0x6c\t\t\t\t0x6c\t\t\/\/ 'l' xxx (TBD)\r\n#define GVC_MSG_0x6d\t\t\t\t0x6d\t\t\/\/ 'm' xxx (TBD)\r\n#define GVC_MSG_0x6e\t\t\t\t0x6e\t\t\/\/ 'n' xxx (TBD)\r\n#define GVC_MSG_0x6f\t\t\t\t0x6f\t\t\/\/ 'o' xxx (TBD)\r\n\r\n#define GVC_MSG_0x70\t\t\t\t0x70\t\t\/\/ 'p' xxx (TBD)\r\n#define GVC_MSG_0x71\t\t\t\t0x71\t\t\/\/ 'q' xxx (TBD)\r\n#define GVC_MSG_0x72\t\t\t\t0x72\t\t\/\/ 'r' xxx (TBD)\r\n#define GVC_MSG_0x73\t\t\t\t0x73\t\t\/\/ 's' xxx (TBD)\r\n#define GVC_MSG_0x74\t\t\t\t0x74\t\t\/\/ 't' xxx (TBD)\r\n#define GVC_MSG_0x75\t\t\t\t0x75\t\t\/\/ 'u' xxx (TBD)\r\n#define GVC_MSG_0x76\t\t\t\t0x76\t\t\/\/ 'v' xxx (TBD)\r\n#define GVC_MSG_0x77\t\t\t\t0x77\t\t\/\/ 'w' xxx (TBD)\r\n#define GVC_MSG_0x78\t\t\t\t0x78\t\t\/\/ 'x' xxx (TBD)\r\n#define GVC_MSG_0x79\t\t\t\t0x79\t\t\/\/ 'y' xxx (TBD)\r\n#define GVC_MSG_0x7a\t\t\t\t0x7a\t\t\/\/ 'z' xxx (TBD)\r\n#define GVC_MSG_0x7b\t\t\t\t0x7b\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x7c\t\t\t\t0x7c\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x7d\t\t\t\t0x7d\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x7e\t\t\t\t0x7e\t\t\/\/ xxx (TBD)\r\n#define GVC_MSG_0x7f\t\t\t\t0x7f\t\t\/\/ STOP (TBD)\r\n\r\n#define GVC_MSG_0xff\t\t\t\t0xff\t\t\/\/ END (TBD)\r\n\r\n#define GVC_DEV_00\t\t\t\t\t0\t\t\t\/\/ GVC DEVICE NO 0 (DO NOT USE THIS!!)\r\n#define GVC_DEV_01\t\t\t\t\t1\t\t\t\/\/ GVC DEVICE NO 1\r\n#define GVC_DEV_02\t\t\t\t\t2\t\t\t\/\/ GVC DEVICE NO 2\r\n#define GVC_DEV_03\t\t\t\t\t3\t\t\t\/\/ GVC DEVICE NO 3\r\n#define GVC_DEV_04\t\t\t\t\t4\t\t\t\/\/ GVC DEVICE NO 4\r\n#define GVC_DEV_05\t\t\t\t\t5\t\t\t\/\/ GVC DEVICE NO 5\r\n#define GVC_DEV_06\t\t\t\t\t6\t\t\t\/\/ GVC DEVICE NO 6\r\n#define GVC_DEV_07\t\t\t\t\t7\t\t\t\/\/ GVC DEVICE NO 7\r\n#define GVC_DEV_08\t\t\t\t\t8\t\t\t\/\/ GVC DEVICE NO 8\r\n#define GVC_DEV_09\t\t\t\t\t9\t\t\t\/\/ GVC DEVICE NO 9\r\n\r\n#define GVC_I2C_MESSAGE_HEADER_SIZE\t4\t\t\t\/\/ I2C\u4e0a\u3092\u6d41\u308c\u308b\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u30d8\u30c3\u30c0\u30fc\u90e8\u5206(format,cmd,data_len)\u306e\u9577\u3055\r\n#define GVC_SERIAL_MESSAGE_HEADER_SIZE\t6\t\t\/\/ \u30b7\u30ea\u30a2\u30eb\u4e0a\u3092\u6d41\u308c\u308b\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u30d8\u30c3\u30c0\u30fc\u90e8\u5206(msg_type, dev_num, format,cmd,data_len)\u306e\u9577\u3055\r\n\r\n#define\tGVC_IR_DATALEN_MAX\t\t\t1568\t\t\/\/ \u8d64\u5916\u7dda\u30c7\u30fc\u30bf\u306e\u6700\u5927\u9577 2013.12.20 \u4eee\u6c7a\u5b9a\r\n\r\n\/\/ \u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u540d\u8a2d\u5b9a\r\n#define\t\tGVC_LOG_FILENAME\t\t&quot;\/var\/log\/gvcd.log&quot;\r\n\r\n\/\/ PID\u30d5\u30a1\u30a4\u30eb\u540d\u8a2d\u5b9a\r\n#define\t\tGVC_PID_FILENAME\t\t&quot;\/var\/run\/gvcd.pid&quot;\r\n\r\n\/\/ \u30e1\u30c3\u30bb\u30fc\u30b8\u30ad\u30e5\u30fc\u30bf\u30a4\u30d7\u3092\u8a2d\u5b9a\r\n#define\t\tCOMMAND_Q\t\t\t1\t\t\t\t\/\/ \u9001\u4fe1(\u547d\u4ee4)\u30e1\u30c3\u30bb\u30fc\u30b8\u30bf\u30a4\u30d7\r\n#define\t\tRESULT_Q\t\t\t9\t\t\t\t\/\/ \u53d7\u4fe1(\u7d50\u679c)\u30e1\u30c3\u30bb\u30fc\u30b8\u30bf\u30a4\u30d7\r\n\r\n\/\/ --------------------------------------------------\r\n\/\/ Structure\r\n\/\/ --------------------------------------------------\r\n\/\/  |   |   |   |   |   |   |   |   |   |   |   |   |   |   |\r\n\/\/ ------------------------------\r\n\/\/ GVC I2C MESSAGE (GVC  Module)\r\n\/\/ ------------------------------\r\ntypedef struct _GVC_I2C_MESSAGE_T_\r\n{\r\n\tunsigned char format;\t\t\t\t\t\t\t\t\/\/ format\r\n\tunsigned char cmd;\t\t\t\t\t\t\t\t\t\/\/ cmd\r\n\tunsigned short int data_len;\t\t\t\t\t\t\/\/ data length\r\n\tunsigned char data&#x5B;];\t\t\t\t\t\t\t\t\/\/ data array (\u6700\u4f4e3\u30d0\u30a4\u30c8\u3067\u3001\u305d\u306e\u6700\u5f8c\u306fchecksum\u304c\u5165\u308b)\r\n} GVC_I2C_MESSAGE_t;\r\n\r\n\/\/ ------------------------------\r\n\/\/ GVC SERIAL MESSAGE (gvcd  GVC)\r\n\/\/ ------------------------------\r\ntypedef struct _GVC_SERIAL_MESSAGE_T_\r\n{\r\n\tunsigned char msg_type;\t\t\t\t\t\t\t\t\/\/ message type\r\n\tunsigned char dev_num;\t\t\t\t\t\t\t\t\/\/ device number\r\n\tunsigned char format;\t\t\t\t\t\t\t\t\/\/ format\r\n\tunsigned char cmd;\t\t\t\t\t\t\t\t\t\/\/ cmd\r\n\tunsigned short int data_len;\t\t\t\t\t\t\/\/ data length\r\n\tunsigned char data&#x5B;];\t\t\t\t\t\t\t\t\/\/ data array (\u6700\u4f4e3\u30d0\u30a4\u30c8\u3067\u3001\u305d\u306e\u6700\u5f8c\u306fchecksum\u304c\u5165\u308b)\r\n} GVC_SERIAL_MESSAGE_t;\r\n\/\/ union\u3067\u8907\u6570\u69cb\u6210\u306b\u3057\u3066\u3082\u3044\u3044\u304b\u306a\u3068\u601d\u3063\u305f\u3051\u3069\u3001\u307e\u3041\u305d\u3053\u307e\u3067\u3044\u3058\u308b\u3088\u308a\u3082\u30c0\u30a4\u30ec\u30af\u30c8\u306b\u30dd\u30a4\u30f3\u30bf\u53c2\u7167\u3067\u5165\u308c\u3066\u3044\u3063\u305f\u307b\u3046\u304c\u65e9\u3044\u3057\u2026\r\n\r\n\/\/ ------------------------------\r\n\/\/ \u547d\u4ee4\u30e1\u30c3\u30bb\u30fc\u30b8(\u3053\u3061\u3089\u306f\u30e1\u30c3\u30bb\u30fc\u30b8\u30ad\u30e5\u30fc\u306b\u4f7f\u3046\u306e\u3067\u3001msg_data&#x5B;]\u306e\u9577\u3055\u306f\u3042\u3089\u304b\u3058\u3081\u6307\u5b9a\u3057\u3066\u3044\u308b)\r\n\/\/ ------------------------------\r\ntypedef struct _GVC_QUEUE_MESSAGE_T_\r\n{\r\n\tunsigned char gvc_num;\t\t\t\t\t\t\t\t\/\/ \u5bfe\u8c61GVC\u306e\u756a\u53f7(\u73fe\u72b6\u306f0x01\u3067\u4e00\u53f0\u306e\u307f\u304c\u5bfe\u8c61)\r\n\tunsigned char msg_type;\t\t\t\t\t\t\t\t\/\/ \u30e1\u30c3\u30bb\u30fc\u30b8\u30bf\u30a4\u30d7(0x05)\r\n\tunsigned char dev_num;\t\t\t\t\t\t\t\t\/\/ \u5bfe\u8c61\u30c7\u30d0\u30a4\u30b9\u756a\u53f7(\u203bGVC\u3067\u628a\u63e1\u3067\u304d\u308b\u30c7\u30d0\u30a4\u30b9\u756a\u53f7)\r\n\tunsigned char format;\t\t\t\t\t\t\t\t\/\/ format\r\n\tunsigned char cmd;\t\t\t\t\t\t\t\t\t\/\/ cmd\r\n\tunsigned short int data_len;\t\t\t\t\t\t\/\/ data length\r\n\tunsigned char data&#x5B;BUFF_SIZE];\t\t\t\t\t\t\/\/ data array (\u6700\u4f4e3\u30d0\u30a4\u30c8\u3067\u3001\u305d\u306e\u6700\u5f8c\u306fchecksum\u304c\u5165\u308b\u3001\u30e1\u30c3\u30bb\u30fc\u30b8\u81ea\u4f53\u306f\u56fa\u5b9a\u9577\u3001GVC\u3068\u306e\u3084\u308a\u53d6\u308a\u306f\u4efb\u610f\u9577\u306bgvcd\u304c\u5909\u63db)\r\n} GVC_QUEUE_MESSAGE_t;\r\n\r\n\/\/ --------------------------------\r\n\/\/ \u30e1\u30c3\u30bb\u30fc\u30b8\u30ad\u30e5\u30fc\u69cb\u9020\u4f53\u3092\u5b9a\u7fa9(gvc_cmd(\u4eee\u79f0)\u3068gvcd\u3068\u306e\u3084\u308a\u53d6\u308a\u306e\u305f\u3081\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u30ad\u30e5\u30fc)\r\n\/\/ --------------------------------\r\ntypedef struct  _GVC_MESSAGE_QUEUE_T_\r\n{\r\n\tunsigned long qtype;\t\t\t\t\t\t\t\t\/\/ \u30e1\u30c3\u30bb\u30fc\u30b8\u30ad\u30e5\u30fc\u30bf\u30a4\u30d7(\u57fa\u672c\u7684\u306b\u306f1=gvc_cmd\u304b\u3089gvcd\u3078\u306e\u547d\u4ee4)\r\n\tGVC_QUEUE_MESSAGE_t q;\t\t\t\t\t\t\t\t\/\/ \u3084\u308a\u53d6\u308a\u3059\u308b\u30e1\u30c3\u30bb\u30fc\u30b8\u30ad\u30e5\u30fc\u30c7\u30fc\u30bf(GVC\u306e\u547d\u4ee4\u5f62\u30e1\u30c3\u30bb\u30fc\u30b8)\r\n} GVC_MESSAGE_QUEUE_t;\r\n\/\/ \u30e1\u30c3\u30bb\u30fc\u30b8\u30ad\u30e5\u30fc\u3001\u3068\u3044\u3046\u304bLinux\u30ec\u30d9\u30eb\u306b\u306a\u308b\u3068\u30c6\u30fc\u30d6\u30eb\u69cb\u9020\u4f53\u306e\u30a2\u30e9\u30a4\u30f3\u30e1\u30f3\u30c8\u304c\u884c\u308f\u308c\u308b\u304b\u3089\u6ce8\u610f\u3059\u308b\u3053\u3068!!\r\n\/\/ PIC\u3067\u306f\u3082\u3061\u308d\u3093\u30e1\u30e2\u30ea\u7a7a\u9593\u7684\u306b\u30ea\u30cb\u30a2\u306b\u6271\u308f\u308c\u308b\u304c\u3001Linux\u3067\u306f\u30e1\u30c3\u30bb\u30fc\u30b8\u5168\u4f53\u306eCRC\u306e\u8a08\u7b97\u306a\u3069\u304c\u3067\u304d\u306a\u3044(\u3081\u3093\u3069\u3044)\r\n\r\n\/\/ --------------------------------------------------\r\n\/\/ Prototype Define\r\n\/\/ --------------------------------------------------\r\n\r\n\/\/ --------------------------------------------------\r\n\/\/ Variable Param\r\n\/\/ --------------------------------------------------\r\n\/\/ CRC-8-CCITT\u30c6\u30fc\u30d6\u30eb\u306e\u914d\u5217\t\u53c2\u8003\uff1ahttp:\/\/blog.goo.ne.jp\/masaki_goo_2006\/e\/b852b25b96de412e0df3b474e406e704\r\nstatic unsigned char CRC8Table&#x5B; 256 ] = {\r\n\t0x00, 0x8D, 0x97, 0x1A, 0xA3, 0x2E, 0x34, 0xB9,\r\n\t0xCB, 0x46, 0x5C, 0xD1, 0x68, 0xE5, 0xFF, 0x72,\r\n\t0x1B, 0x96, 0x8C, 0x01, 0xB8, 0x35, 0x2F, 0xA2,\r\n\t0xD0, 0x5D, 0x47, 0xCA, 0x73, 0xFE, 0xE4, 0x69,\r\n\t0x36, 0xBB, 0xA1, 0x2C, 0x95, 0x18, 0x02, 0x8F,\r\n\t0xFD, 0x70, 0x6A, 0xE7, 0x5E, 0xD3, 0xC9, 0x44,\r\n\t0x2D, 0xA0, 0xBA, 0x37, 0x8E, 0x03, 0x19, 0x94,\r\n\t0xE6, 0x6B, 0x71, 0xFC, 0x45, 0xC8, 0xD2, 0x5F,\r\n\r\n\t0x6C, 0xE1, 0xFB, 0x76, 0xCF, 0x42, 0x58, 0xD5,\r\n\t0xA7, 0x2A, 0x30, 0xBD, 0x04, 0x89, 0x93, 0x1E,\r\n\t0x77, 0xFA, 0xE0, 0x6D, 0xD4, 0x59, 0x43, 0xCE,\r\n\t0xBC, 0x31, 0x2B, 0xA6, 0x1F, 0x92, 0x88, 0x05,\r\n\t0x5A, 0xD7, 0xCD, 0x40, 0xF9, 0x74, 0x6E, 0xE3,\r\n\t0x91, 0x1C, 0x06, 0x8B, 0x32, 0xBF, 0xA5, 0x28,\r\n\t0x41, 0xCC, 0xD6, 0x5B, 0xE2, 0x6F, 0x75, 0xF8,\r\n\t0x8A, 0x07, 0x1D, 0x90, 0x29, 0xA4, 0xBE, 0x33,\r\n\r\n\t0xD8, 0x55, 0x4F, 0xC2, 0x7B, 0xF6, 0xEC, 0x61,\r\n\t0x13, 0x9E, 0x84, 0x09, 0xB0, 0x3D, 0x27, 0xAA,\r\n\t0xC3, 0x4E, 0x54, 0xD9, 0x60, 0xED, 0xF7, 0x7A,\r\n\t0x08, 0x85, 0x9F, 0x12, 0xAB, 0x26, 0x3C, 0xB1,\r\n\t0xEE, 0x63, 0x79, 0xF4, 0x4D, 0xC0, 0xDA, 0x57,\r\n\t0x25, 0xA8, 0xB2, 0x3F, 0x86, 0x0B, 0x11, 0x9C,\r\n\t0xF5, 0x78, 0x62, 0xEF, 0x56, 0xDB, 0xC1, 0x4C,\r\n\t0x3E, 0xB3, 0xA9, 0x24, 0x9D, 0x10, 0x0A, 0x87,\r\n\r\n\t0xB4, 0x39, 0x23, 0xAE, 0x17, 0x9A, 0x80, 0x0D,\r\n\t0x7F, 0xF2, 0xE8, 0x65, 0xDC, 0x51, 0x4B, 0xC6,\r\n\t0xAF, 0x22, 0x38, 0xB5, 0x0C, 0x81, 0x9B, 0x16,\r\n\t0x64, 0xE9, 0xF3, 0x7E, 0xC7, 0x4A, 0x50, 0xDD,\r\n\t0x82, 0x0F, 0x15, 0x98, 0x21, 0xAC, 0xB6, 0x3B,\r\n\t0x49, 0xC4, 0xDE, 0x53, 0xEA, 0x67, 0x7D, 0xF0,\r\n\t0x99, 0x14, 0x0E, 0x83, 0x3A, 0xB7, 0xAD, 0x20,\r\n\t0x52, 0xDF, 0xC5, 0x48, 0xF1, 0x7C, 0x66, 0xEB,\r\n};\r\n\r\n\/\/ --------------------------------------------------\r\n\/\/ Sub Routine\r\n\/\/ --------------------------------------------------\r\n\/\/ ------------------------------\r\n\/\/ CRC8\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u8a08\u7b97\r\n\/\/ ------------------------------\r\nunsigned char GetCRC8( const void *buff, size_t size )\r\n{\r\n\tunsigned char *data = (unsigned char *)buff;\r\n\tunsigned char  crc8 = 0x00;\r\n\r\n\twhile ( size != 0 )\r\n\t{\r\n\t\tcrc8 = CRC8Table&#x5B; crc8 ^ *data ];\r\n\t\tdata++;\r\n\t\tsize--;\r\n\t}\r\n\treturn crc8;\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\/\/ &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; \/\/ Global Versatile Controler http:\/\/www.gvc-on.net\/ \/\/  &hellip; <a href=\"http:\/\/www.gvc-on.net\/?page_id=614\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":609,"menu_order":10,"comment_status":"closed","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-614","page","type-page","status-publish","hentry"],"aioseo_notices":[],"_links":{"self":[{"href":"http:\/\/www.gvc-on.net\/index.php?rest_route=\/wp\/v2\/pages\/614","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gvc-on.net\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/www.gvc-on.net\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/www.gvc-on.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gvc-on.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=614"}],"version-history":[{"count":2,"href":"http:\/\/www.gvc-on.net\/index.php?rest_route=\/wp\/v2\/pages\/614\/revisions"}],"predecessor-version":[{"id":616,"href":"http:\/\/www.gvc-on.net\/index.php?rest_route=\/wp\/v2\/pages\/614\/revisions\/616"}],"up":[{"embeddable":true,"href":"http:\/\/www.gvc-on.net\/index.php?rest_route=\/wp\/v2\/pages\/609"}],"wp:attachment":[{"href":"http:\/\/www.gvc-on.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=614"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}