| | |
| | | import androidx.lifecycle.Observer; |
| | | |
| | | import com.anyun.exam.lib.util.Speaker; |
| | | import com.anyun.im_lib.util.ByteUtil; |
| | | import com.google.android.material.textfield.TextInputEditText; |
| | | import com.safeluck.aykj.utils.BytesUtils; |
| | | |
| | | import me.yokeyword.fragmentation.SupportFragment; |
| | | import safeluck.drive.evaluation.DB.criterias.CriteriaForI; |
| | | import safeluck.drive.evaluation.DB.criterias.viewmodel.CriteriaIViewModel; |
| | | import safeluck.drive.evaluation.R; |
| | | import safeluck.drive.evaluation.im.MessageProcessor; |
| | | import safeluck.drive.evaluation.platformMessage.GainStuMessage; |
| | | import safeluck.drive.evaluation.platformMessage.JKClientCommonMessage; |
| | | import safeluck.drive.evaluation.platformMessage.JKRegisterMessage; |
| | | import safeluck.drive.evaluation.platformMessage.RegisterMessage; |
| | | import safeluck.drive.evaluation.im.IMSClientBootstrap; |
| | | |
| | |
| | | |
| | | String userId = "100002"; |
| | | String token = "token_" + userId; |
| | | String hosts = "[{\"host\":\"47.93.80.84\", \"port\":12125}]"; |
| | | // String hosts = "[{\"host\":\"192.168.31.77\", \"port\":12125}]"; |
| | | // String hosts = "[{\"host\":\"47.93.80.84\", \"port\":12125}]"; |
| | | // String hosts = "[{\"host\":\"47.93.157.103\", \"port\":2020}]"; |
| | | String hosts = "[{\"host\":\"192.168.31.77\", \"port\":12125}]"; |
| | | |
| | | IMSClientBootstrap.getInstance().init(userId,token,hosts,1); |
| | | break; |
| | |
| | | //清除app_status 表 |
| | | // OneTimeWorkRequest oneTimeWorkRequest = new OneTimeWorkRequest.Builder(AppStatusInitWork.class).build(); |
| | | // WorkManager.getInstance(_mActivity).enqueue(oneTimeWorkRequest); |
| | | RegisterMessage registerMessage = new RegisterMessage((short)0x802); |
| | | registerMessage.setCityid((short) 1); |
| | | registerMessage.setProviceId((short)23); |
| | | registerMessage.setImei("460123874561"); |
| | | registerMessage.setModel("123"); |
| | | registerMessage.setSn("2019101500000001"); |
| | | // RegisterMessage registerMessage = new RegisterMessage((short)0x802); |
| | | // registerMessage.setCityid((short) 1); |
| | | // registerMessage.setProviceId((short)23); |
| | | // registerMessage.setImei("460123874561"); |
| | | // registerMessage.setModel("123"); |
| | | // registerMessage.setSn("2019101500000001"); |
| | | |
| | | |
| | | // GainStuMessage gainStuMessage = new GainStuMessage((short) 0x201); |
| | | // gainStuMessage.setId("123456789"); |
| | | // gainStuMessage.setExamaCourse((short) 0); |
| | | // MessageProcessor.getInstance().sendMessage(gainStuMessage.toBytes()); |
| | | |
| | | ByteUtil.str2Bcd("13021245"); |
| | | String strbcd=ByteUtil.bcd2Str(ByteUtil.str2Bcd("13021245")); |
| | | Log.i(TAG, "onClick: strbcd="+strbcd); |
| | | |
| | | JKRegisterMessage jkRegisterMessage = new JKRegisterMessage(); |
| | | jkRegisterMessage.setMessageLen(55); |
| | | // jkRegisterMessage.phone = "13021245"; |
| | | jkRegisterMessage.phone = "0008618513021245"; |
| | | jkRegisterMessage.proviceid = 23; |
| | | jkRegisterMessage.messageId = 0x100; |
| | | jkRegisterMessage.protocalVer = 235; |
| | | jkRegisterMessage.cityid = 1; |
| | | jkRegisterMessage.imei = "460123874561"; |
| | | jkRegisterMessage.model = "123"; |
| | | jkRegisterMessage.sn = "0314200100000004"; |
| | | |
| | | Log.i(TAG, "onClick: msg len "+jkRegisterMessage.getMessageLen()+" "+ jkRegisterMessage.props.value); |
| | | byte[] str = jkRegisterMessage.toBytes(); |
| | | MessageProcessor.getInstance().sendMessage(str); |
| | | Log.i(TAG, "onClick: "+ BytesUtils.bytesToHexString(str)+" ============"); |
| | | |
| | | JKClientCommonMessage jkClientCommonMessage =new JKClientCommonMessage(); |
| | | jkClientCommonMessage.setMessageLen(5); |
| | | jkClientCommonMessage.messageId = 0x8100; |
| | | jkClientCommonMessage.protocalVer = 235; |
| | | // jkClientCommonMessage.phone = "13021245"; |
| | | jkClientCommonMessage.respMessageId = "8001"; |
| | | jkClientCommonMessage.respNo = 15; |
| | | jkClientCommonMessage.result =1; |
| | | String str1 = jkClientCommonMessage.toString(); |
| | | |
| | | Log.i(TAG, "onClick1: "+ str1+" ============"); |
| | | break; |
| | | } |
| | | } |