Search code examples
objective-cserial-communicationxcode6.4

Data Transmission and Receivinge using RedPark L2DB9V SDK


I am using Redpark sdk and Serical Cable L2-DB9V for communication between iPhone and MAX 3232 Board using MAX3232 usb to digital converter. So for that purpose I have used demo app provided by RedPark to understand functionality of sdk. Sdk has "RscMgr Class" in which all methods are implemented for communication purpose to send and receive data for example

- (int) write:(UInt8 *)data length:(UInt32)length;
- (int) read:(UInt8 *)data length:(UInt32)length;
- (int) getReadBytesAvailable;
- (void) writeData:(NSData *)data;

Delegate Methods:

- (void) cableConnected:(NSString *)protocol;
- (void) cableDisconnected;
- (void) portStatusChanged;
- (void) readBytesAvailable:(UInt32)length;

In My Case, Cable connection and disconnection methods have been called. I am sending data using:

- (int) write:(UInt8 *)data length:(UInt32)length;

and implemented loopback functionality to receive data back. In that case

- (void) readBytesAvailable:(UInt32)length;

should be called but it is not calling and i am unable to find out its cause. And Also there is no way to make sure that data is being sent by using one of these methods or not. Please, help if any one have idea about this problem will be thankful.


Solution

  • I have resolved issue as I was not sending correct format of Data Buffer to hardware. By sending correct data buffer format I solved it.

    Thanks