I think your second transaction needs to be read-only (i.e. writeLength =
0).
Note that for both read and write buffers, if the length is 0 the buffer
can be null (you don't need the funny zero-length array).


On Tue, May 6, 2014 at 5:13 PM, Alexander Bashmakov <[email protected]>wrote:

> Some more progress made, new code:
>
>
>    byte[] request = new byte[] {0x00};
>    byte[] response = new byte[0];
>    Log.i("Sending MR command");
>    boolean result = mTwi.writeRead(0x27, false, request, request.length,
> response, response.length);
>    Log.i("MR command result: " + result);         // result is true after
> power cycling
>    Thread.sleep(100);
>    request = new byte[] {0x01};
>
>    response = new byte[4];
>    Log.i("Sending DF command");
>    result = mTwi.writeRead(0x27, false, request, request.length, response,
> response.length);
>    Log.i("DF command result: " + result);          // result is false
>
> I am struggling to understand what should the value of the second request
> be for Data Fetch.
>
>
>
> On Tuesday, May 6, 2014 2:27:54 PM UTC-7, Alexander Bashmakov wrote:
>>
>> Hi Troy,
>>
>> Would you be able to post a sample of your working code? I'm also trying
>> to use HIT-6130 and having issues. Here's my code so far:
>>
>>    byte[] request = new byte[] {0x00};
>>    byte[] response = new byte[0];
>>    Log.i("Sending MR command");
>>    boolean result = twi.writeRead(0x27, false, request, request.length,
>> response, response.length);
>>    Log.i("MR command result: " + result);
>>    Thread.sleep(100);
>>    response = new byte[4];
>>    Log.i("Sending DF command");
>>    result = twi.writeRead(0x27, false, request, request.length, response,
>> response.length);
>>    Log.i("DF command result: " + result);
>>
>> After the second writeRead, I get a ConnectionLostException and the last
>> log message never gets printed. Any help would be appreciated.
>>
>>
>> On Wednesday, June 5, 2013 5:31:19 AM UTC-7, Troy Collinsworth wrote:
>>>
>>> Awesome sauce!!! That worked like a charm. Thanks for the quick response.
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "ioio-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/ioio-users.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"ioio-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/ioio-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to