|
- /*获取群组详情*/
- public static void sendCommandConfInfo(){
- BVCSP_Command command = creteCommand(BVCU_METHOD_TYPE.BVCU_METHOD_QUERY,BVCU_SUBMETHOD_TYPE.BVCU_SUBMETHOD_CONF_INFO);
- bytesCopy(command.szTargetID, "CONF_5FFEE650".getBytes());
- command.stMsgContent = new BVCSP_CmdMsgContent();
- int result = VoiceLibrary.INSTANCE.BVCSP_SendCmd(hSession,command);
- System.out.println("获取群组详情: " + result);
- }
copycode- case BVCU_SUBMETHOD_TYPE.BVCU_SUBMETHOD_CONF_INFO:
- System.out.println("群聊详情回调:"+pParam.iResult+",iPercent:"+pParam.iPercent
- + ",iMethod:"+pCommand.iMethod+",iSubMethod: "+pCommand.iSubMethod);
- BVCU_Conf_Info confInfo = pointer2Structure(pParam.stContent.pData, BVCU_Conf_Info.class);
- System.out.println("群聊名称:"+new String(confInfo.baseInfo.szName)+",人员数:"+confInfo.iParticipatorCount);
- for (int i = 0; i < confInfo.pParticipators.length; i++) {
- BVCU_Conf_Participator_Info participator = confInfo.pParticipators[i];
- System.out.println("id:"+ new String(participator.szID) +",人员名:"+new String(participator.szUserName)
- +",addr:"+new String(participator.szAddr)+",ID:"+participator.iPID);
- }
copycode- public static <Element extends Structure> Element pointer2Structure(Pointer pParam, Class<Element> res)
- { Element Param = null;
- try {
- Param = res.newInstance();
- Pointer facePointer = Param.getPointer();
- byte[] byteArray = pParam.getByteArray(0, Param.size());
- facePointer.write(0,byteArray,0,Param.size());
- Param.read();
- } catch (InstantiationException | IllegalAccessException e) {
- e.printStackTrace();
- }
- return Param;
- }
copycode |
|