diff --git a/tool/gcn64lib.c b/tool/gcn64lib.c index dd83d7d..2c4749a 100644 --- a/tool/gcn64lib.c +++ b/tool/gcn64lib.c @@ -132,6 +132,22 @@ int gcn64lib_getSignature(gcn64_hdl_t hdl, char *dst, int dstmax) return 0; } +int gcn64lib_forceVibration(gcn64_hdl_t hdl, unsigned char channel, unsigned char vibrate) +{ + unsigned char cmd[3]; + int n; + + cmd[0] = RQ_GCN64_SET_VIBRATION; + cmd[1] = channel; + cmd[2] = vibrate; + + n = gcn64_exchange(hdl, cmd, 3, cmd, sizeof(cmd)); + if (n<0) + return n; + + return 0; +} + int gcn64lib_rawSiCommand(gcn64_hdl_t hdl, unsigned char channel, unsigned char *tx, unsigned char tx_len, unsigned char *rx, unsigned char max_rx) { unsigned char cmd[3 + tx_len]; diff --git a/tool/gcn64lib.h b/tool/gcn64lib.h index 368a3a7..f8046bf 100644 --- a/tool/gcn64lib.h +++ b/tool/gcn64lib.h @@ -14,6 +14,7 @@ int gcn64lib_getConfig(gcn64_hdl_t hdl, unsigned char param, unsigned char *rx, int gcn64lib_rawSiCommand(gcn64_hdl_t hdl, unsigned char channel, unsigned char *tx, unsigned char tx_len, unsigned char *rx, unsigned char max_rx); int gcn64lib_getVersion(gcn64_hdl_t hdl, char *dst, int dstmax); int gcn64lib_getSignature(gcn64_hdl_t hdl, char *dst, int dstmax); +int gcn64lib_forceVibration(gcn64_hdl_t hdl, unsigned char channel, unsigned char vibrate); int gcn64lib_getControllerType(gcn64_hdl_t hdl, int chn); const char *gcn64lib_controllerName(int type); int gcn64lib_bootloader(gcn64_hdl_t hdl);