}
- (void)initSdk{
- [LogManager log:@"开始初始化"];
+ [LogManager log:@"[byte]开始初始化"];
stb_app_printf_str_register(cus_printf_str);
// NSString *appId = @"tis_test";
// NSString *appId = @"app_10dyx2ai21r2qkar";
void STB_STDCALL cus_printf_str(char* str)
{
dispatch_async(dispatch_get_main_queue(), ^{
- NSString *logStr = [NSString stringWithFormat:@"%s", str];
+ NSString *logStr = [NSString stringWithFormat:@"[byte]%s", str];
[LogManager log:logStr];
});
dispatch_async(dispatch_get_main_queue(), ^{
switch (type) {
case STB_DYNREG_SUCCESS:
- [LogManager log:@"STB_DYNREG_SUCCESS"];
+ [LogManager log:@"[byte]STB_DYNREG_SUCCESS"];
break;
case STB_DYNREG_FAIL:
- [LogManager log:@"STB_DYNREG_FAIL"];
+ [LogManager log:@"[byte]STB_DYNREG_FAIL"];
break;
case STB_MQTT_CONNECT_SUCCESS:
- [LogManager log:@"STB_MQTT_CONNECT_SUCCESS"];
+ [LogManager log:@"[byte]STB_MQTT_CONNECT_SUCCESS"];
stb_app_get_token_async();
break;
case STB_MQTT_CONNECT_FAIL:
- [LogManager log:@"STB_MQTT_CONNECT_FAIL"];
+ [LogManager log:@"[byte]STB_MQTT_CONNECT_FAIL"];
break;
case STB_MQTT_CONNECT_OFFLINE:
- [LogManager log:@"STB_MQTT_CONNECT_OFFLINE"];
+ [LogManager log:@"[byte]STB_MQTT_CONNECT_OFFLINE"];
break;
case STB_MQTT_CONNECT_ONLINE:
- [LogManager log:@"STB_MQTT_CONNECT_ONLINE"];
+ [LogManager log:@"[byte]STB_MQTT_CONNECT_ONLINE"];
break;
case STB_DM_DATA_ARRIVED_TOKEN:
//token
NSData *data = [[NSData alloc] initWithBytes:report length:data_len];
[ByteDanceSdk shared].info.token = [AiMouseTools dataToUtf8String:data];
- [LogManager log:[NSString stringWithFormat:@"STB_DM_DATA_ARRIVED_TOKEN = %@",[ByteDanceSdk shared].info.token]];
+ [LogManager log:[NSString stringWithFormat:@"[byte]STB_DM_DATA_ARRIVED_TOKEN = %@",[ByteDanceSdk shared].info.token]];
[[ByteDanceSdk shared] checkAuthSuccess];
break;
}
//host
NSData *data = [[NSData alloc] initWithBytes:report length:data_len];
[ByteDanceSdk shared].info.host = [AiMouseTools dataToUtf8String:data];
- [LogManager log:[NSString stringWithFormat:@"STB_DM_DATA_ARRIVED_HOST = %@",[ByteDanceSdk shared].info.host]];
+ [LogManager log:[NSString stringWithFormat:@"[byte]STB_DM_DATA_ARRIVED_HOST = %@",[ByteDanceSdk shared].info.host]];
[[ByteDanceSdk shared] checkAuthSuccess];
break;
}
//params
NSData *data = [[NSData alloc] initWithBytes:report length:data_len];
[ByteDanceSdk shared].info.urlParams = [AiMouseTools dataToUtf8String:data];
- [LogManager log:[NSString stringWithFormat:@"STB_DM_DATA_ARRIVED_PARAMS_SIGN = %@",[ByteDanceSdk shared].info.urlParams]];
+ [LogManager log:[NSString stringWithFormat:@"[byte]STB_DM_DATA_ARRIVED_PARAMS_SIGN = %@",[ByteDanceSdk shared].info.urlParams]];
[[ByteDanceSdk shared] checkAuthSuccess];
break;
}
default:
- [LogManager log:@"UNKNOWN_MSG"];
+ [LogManager log:@"[byte] UNKNOWN_MSG"];
break;
}
NSData *data = [[NSData alloc] initWithBytes:report length:data_len];
- [LogManager log:[NSString stringWithFormat:@"event_callback type = %u,data = %@",type,[AiMouseTools dataToHexString:data]]];
- [LogManager log:[NSString stringWithFormat:@"str = %@",[AiMouseTools dataToUtf8String:data]]];
+ [LogManager log:[NSString stringWithFormat:@"[byte] type = %u,data = %@",type,[AiMouseTools dataToHexString:data]]];
+ [LogManager log:[NSString stringWithFormat:@"[byte]%@",[AiMouseTools dataToUtf8String:data]]];
});
}
int32_t STB_STDCALL cus_hal_send_data2device(uint8_t* data, uint32_t len)
{
NSData *cmdData = [[NSData alloc] initWithBytes:data length:len];
- [LogManager log:[NSString stringWithFormat:@"send2device = %@",[AiMouseTools dataToHexString_placeholder:cmdData]]];
+ [LogManager log:[NSString stringWithFormat:@"[byte]send2device = %@",[AiMouseTools dataToHexString_placeholder:cmdData]]];
NSMutableData *fullData = [[NSMutableData alloc] init];
uint8_t head[] = { 0x2d, 0x24, 0x24};