Commit 21e65601ecc1d9c18dd5b423d56403cd043acec7
1 parent
8e9921cf
documents update,switch control when paly movie
Showing
4 changed files
with
16 additions
and
10 deletions
| @@ -46,7 +46,7 @@ bleBroadcastReceiver.setResponseObj(new GREENCITYBLEProtocolFactory.GREENCITYBle | @@ -46,7 +46,7 @@ bleBroadcastReceiver.setResponseObj(new GREENCITYBLEProtocolFactory.GREENCITYBle | ||
| 46 | ``` | 46 | ``` |
| 47 | 47 | ||
| 48 | ## 1.2 智能灯光 | 48 | ## 1.2 智能灯光 |
| 49 | -智能灯光使用的是大豆的方案,基于蓝牙4.0,官方app是dadouLight。使用时需要`add mess`,基出厂的默认配置均为`mesh name:telink_zz,pwd:123`,配置成功后,调用相关方法可以通过mesh name寻找当前范围内是否有相关智能灯存在,若存在会登录,成功后即可控制。 | 49 | +智能灯光使用的是大豆的方案,基于蓝牙4.0,官方app是dadouLight。使用时需要`add mess`,基出厂的默认配置均为`mesh name:telink_zz,pwd:123`,配置成功后,调用相关方法可以通过mesh name寻找当前范围内是否有相关智能灯存在,若存在会登录,成功后即可控制。踢除后灯光成功登录后灯光下显示的是3F:99,此时`mesh name `应为`out_of_mesh` |
| 50 | **注意:在重设置`mesh name`时,在设置mesh页面将`mesh name` 填入`factory name`,保存后,一定要等所连灯消失后再去点`network scanning`,否则很大的可能会设置失败,失败后需要将,`mesh name `改回去再改一次** | 50 | **注意:在重设置`mesh name`时,在设置mesh页面将`mesh name` 填入`factory name`,保存后,一定要等所连灯消失后再去点`network scanning`,否则很大的可能会设置失败,失败后需要将,`mesh name `改回去再改一次** |
| 51 | 主要使用流程概述如下 | 51 | 主要使用流程概述如下 |
| 52 | > * 注册application主要用于初始化`Mesh`启动灯光相关服务 | 52 | > * 注册application主要用于初始化`Mesh`启动灯光相关服务 |
| @@ -30,7 +30,7 @@ public class SocketService extends Service { | @@ -30,7 +30,7 @@ public class SocketService extends Service { | ||
| 30 | private static final int ROOM_NOT_EXIST_M = 1002; | 30 | private static final int ROOM_NOT_EXIST_M = 1002; |
| 31 | private static final int HEAT_BEAT_RTN = 1003; | 31 | private static final int HEAT_BEAT_RTN = 1003; |
| 32 | 32 | ||
| 33 | - public static final String HOST = "192.168.200.191";// "192.168.1.21";// | 33 | + public static final String HOST = "121.43.189.162";// "192.168.1.21";// |
| 34 | public static final int PORT = 9501; | 34 | public static final int PORT = 9501; |
| 35 | 35 | ||
| 36 | public static final String END_SYMBOL = "\\r\\n\\r\\n";//心跳包内容 | 36 | public static final String END_SYMBOL = "\\r\\n\\r\\n";//心跳包内容 |
| @@ -880,10 +880,10 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen | @@ -880,10 +880,10 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen | ||
| 880 | openDoor(); | 880 | openDoor(); |
| 881 | Log.d("event bus", messageEvent.getMessage()); | 881 | Log.d("event bus", messageEvent.getMessage()); |
| 882 | Log.d("event bus", "open door"); | 882 | Log.d("event bus", "open door"); |
| 883 | - MessageEvent msgEvent = new MessageEvent(); | ||
| 884 | - msgEvent.setEventId(0x19910); | ||
| 885 | - msgEvent.setMessage("open_switch"); | ||
| 886 | - EventBus.getDefault().post(msgEvent); | 883 | +// MessageEvent msgEvent = new MessageEvent(); |
| 884 | +// msgEvent.setEventId(0x19910); | ||
| 885 | +// msgEvent.setMessage("open_switch"); | ||
| 886 | +// EventBus.getDefault().post(msgEvent); | ||
| 887 | break; | 887 | break; |
| 888 | 888 | ||
| 889 | case 0x19910: | 889 | case 0x19910: |
| @@ -91,19 +91,25 @@ public class CinemaControlService extends Service { | @@ -91,19 +91,25 @@ public class CinemaControlService extends Service { | ||
| 91 | // if (true) { | 91 | // if (true) { |
| 92 | // return; | 92 | // return; |
| 93 | // } | 93 | // } |
| 94 | + MessageEvent msgEvent = new MessageEvent(); | ||
| 94 | switch (state) { | 95 | switch (state) { |
| 95 | case 0://空闲 | 96 | case 0://空闲 |
| 96 | fadeIn(); | 97 | fadeIn(); |
| 97 | - MessageEvent msgEvent = new MessageEvent(); | ||
| 98 | msgEvent.setEventId(0x19910); | 98 | msgEvent.setEventId(0x19910); |
| 99 | - msgEvent.setMessage("close_switch"); | 99 | + msgEvent.setMessage("open_switch"); |
| 100 | EventBus.getDefault().post(msgEvent); | 100 | EventBus.getDefault().post(msgEvent); |
| 101 | break; | 101 | break; |
| 102 | case 1://播放 | 102 | case 1://播放 |
| 103 | fadeOut(); | 103 | fadeOut(); |
| 104 | + msgEvent.setEventId(0x19910); | ||
| 105 | + msgEvent.setMessage("close_switch"); | ||
| 106 | + EventBus.getDefault().post(msgEvent); | ||
| 104 | break; | 107 | break; |
| 105 | case 2://暂停 | 108 | case 2://暂停 |
| 106 | fadeIn(); | 109 | fadeIn(); |
| 110 | + msgEvent.setEventId(0x19910); | ||
| 111 | + msgEvent.setMessage("open_switch"); | ||
| 112 | + EventBus.getDefault().post(msgEvent); | ||
| 107 | break; | 113 | break; |
| 108 | } | 114 | } |
| 109 | } | 115 | } |
| @@ -227,7 +233,7 @@ public class CinemaControlService extends Service { | @@ -227,7 +233,7 @@ public class CinemaControlService extends Service { | ||
| 227 | int address = 0xFFFF; | 233 | int address = 0xFFFF; |
| 228 | byte[] params = new byte[]{0x01, 0x00, 0x00}; | 234 | byte[] params = new byte[]{0x01, 0x00, 0x00}; |
| 229 | if (TelinkLightService.Instance().sendCommandNoResponse(opcode, address, params)) { | 235 | if (TelinkLightService.Instance().sendCommandNoResponse(opcode, address, params)) { |
| 230 | - Log.d("aidl","open all success"); | 236 | + Log.d("aidl", "open all success"); |
| 231 | } | 237 | } |
| 232 | } | 238 | } |
| 233 | 239 | ||
| @@ -236,7 +242,7 @@ public class CinemaControlService extends Service { | @@ -236,7 +242,7 @@ public class CinemaControlService extends Service { | ||
| 236 | int address = 0xFFFF; | 242 | int address = 0xFFFF; |
| 237 | byte[] params = new byte[]{0x00, 0x00, 0x00}; | 243 | byte[] params = new byte[]{0x00, 0x00, 0x00}; |
| 238 | if (TelinkLightService.Instance().sendCommandNoResponse(opcode, address, params)) { | 244 | if (TelinkLightService.Instance().sendCommandNoResponse(opcode, address, params)) { |
| 239 | - Log.d("aidl","open all success"); | 245 | + Log.d("aidl", "open all success"); |
| 240 | } | 246 | } |
| 241 | } | 247 | } |
| 242 | 248 |
Please
register
or
login
to post a comment