/** * Sends a message to the SDK asking it to set all the fans with a specific smell in a specific surroundPosition to a specified speed. * @param aSurroundPosition group of Cilias we want this to apply to. * @param aSmell we want the user to smell the SDK uses this to find fans with the smell. * @param aFanSpeed a value between 0-255 specifying how fast we want the fant to spin. */ public static void setFan(SurroundPosition aSurroundPosition, SmellList aSmell, byte aFanSpeed) { string toSend = ""; if (aSurroundPosition == SurroundPosition.All) { toSend = "[" + aSurroundPosition.ToString() + "F," + aSmell.ToString() + "," + aFanSpeed.ToString("D3") + "]"; } else { toSend = "[G<" + (byte)aSurroundPosition + ">F," + aSmell.ToString() + "," + aFanSpeed.ToString("D3") + "]"; } sendMessageToCilia(toSend); //Debug.Log(toSend); //Debug.Log(mIsConnected); }
/** * Sends a message to the SDK to set a surround position's specific light nuber to a RGB color * @param aSurroundPosition enumerated value indicating which group of Cilias we want to change the lighting on. * @param aLightNumber between 1-6 of which light we want to change the color of. * @param aRedValue between 0-255 of how red the light will be. * @param aGreenValue between 0-255 of how green the light will be * @param aBlueValue between 0-255 of how blue the light will be */ public static void setLight(SurroundPosition aSurroundPosition, uint aLightNumber, byte aRedValue, byte aGreenValue, byte aBlueValue) { if (aLightNumber > 6) { aLightNumber = 6; } string toSend = ""; if (aSurroundPosition == SurroundPosition.All) { toSend = "[" + aSurroundPosition.ToString() + ",N" + aLightNumber.ToString("D1") + aRedValue.ToString("D3") + aGreenValue.ToString("D3") + aBlueValue.ToString("D3") + "]"; } else { toSend = "[G<" + (byte)aSurroundPosition + ">,N" + aLightNumber.ToString("D1") + aRedValue.ToString("D3") + aGreenValue.ToString("D3") + aBlueValue.ToString("D3") + "]"; } sendMessageToCilia(toSend); }