vendredi 13 février 2015

Data transmitting from jd2xx to hijack iOS library

I bought the Hijack Development kit from Seeedstudio, including Hijack main board and programmer daughterboard. After connecting the Hijack main board to the programmer board, I suppose that the data could be transmitted from PC client to libHijack in iPhone/iPad.


Let’s say:

J: jd2xx client on windows 7.

P: programmer board.

H: Hijack main board

L: an iOS library developed for receiving data from the iPhone's audio interface.


The expected data flow: J —>P —>H —>L


While sending some data by jd2xx client, the red LED D5 is lit(looks good) but no response in L(only some noises invoking the callback method).


Did I miss something?

I appreciate any idea or suggestion.


Here is jd2xx code:



JD2XX jd = new JD2XX();
try {
jd.open(0);

jd.setBaudRate(9200);
jd.setDataCharacteristics(8, JD2XX.STOP_BITS_1, JD2XX.PARITY_NONE);
jd.setFlowControl(JD2XX.FLOW_NONE, 0, 0);
jd.setTimeouts(1000, 1000);

String msg = "Hey, FDTI Chip!";
jd.write(msg.getBytes());

jd.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}


Here is iOS code:



- (void)viewDidLoad {
[super viewDidLoad];
self.hiJackMgr = [HiJackMgr new];
[self.hiJackMgr setDelegate:self];
}

- (int)receive:(UInt8)data{
NSString *msg = [NSString stringWithFormat:@"%f", data];
NSLog(msg);
dispatch_async(dispatch_get_main_queue(), ^{
[self.msgLabel setText:msg];
});
return data;
}

Aucun commentaire:

Enregistrer un commentaire