Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Att Server: support "Prepare Write Request" and "Execute Write Request" #60

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chenkaie
Copy link
Contributor

@chenkaie chenkaie commented Oct 16, 2017

Description

Implement below two operation

  • Prepare Write Request [3.4.6.1 & 3.4.6.2]
  • Execute Write Request [3.4.6.3]

Test

  • Test with LightBlue

    • Test ASCII string: 12345567890x20
      image
  • Before : can not receive message longer than MTU

$ sudo ./server -device "prepare_write" -du 1000000s
Advertising for 277h46m40s...

handleExchangeMTURequest ... 104, 104

2017/10/16 17:05:06 TODO: indicate client when the services are changed
2017/10/16 17:05:10 count: Read 0
2017/10/16 17:05:40 count: Wrote 123
2017/10/16 17:06:46 count: Wrote 1234556789012345567890
2017/10/16 17:06:56 count: Wrote 12345567890

2017/10/16 17:07:05 count: Wrote 123455678901234556789012345567890
2017/10/16 17:07:12 count: Wrote 123455678901234556789012345567890123455678901234556789012345567890

<<<<------ CAN NOT RECEVIE LONGER STRING HERE ----->>>>
  • After : can recive message longer than MTU
$ sudo ./server -device "prepare_write" -du 1000000s
Advertising for 277h46m40s...

handleExchangeMTURequest ... 104, 104
>>> handleWriteRequest -> r.AttributeHandle:  15
2017/10/16 16:58:53 count: Read 0

>>> handlePrepareWriteRequest -> r.AttributeHandle:  18
>>>> data: 3132333435353637383930313233343535363738393031323334353536373839303132333435353637383930313233343535363738393031323334353536373839303132333435353637383930313233343535363738393031323334353536373
83930, offset: 0, 0x0

>>> handlePrepareWriteRequest -> r.AttributeHandle:  18
>>>> data: 3132333435353637383930313233343535363738393031323334353536373839303132333435353637383930313233343535363738393031323334353536373839303132333435353637383930313233343535363738393031323334353536373
83930, offset: 99, 0xc4200d6d80

>>> handlePrepareWriteRequest -> r.AttributeHandle:  18
>>>> data: 313233343535363738393031323334353536373839303132333435353637383930, offset: 198, 0xc4200d6d80
2017/10/16 16:59:01 count: Wrote 123455678901234556789012345567890123455678901234556789012345567890123455678901234556789012345567890123455678901234556789012345567890123455678901234556789012345567890123455
678901234556789012345567890123455678901234556789012345567890
q
>>> handlePrepareWriteRequest -> r.AttributeHandle:  18
>>>> data: 3132333435353637383930313233343535363738393031323334353536373839303132333435353637383930313233343535363738393031323334353536373839303132333435353637383930313233343535363738393031323334353536373
83930, offset: 0, 0x0

>>> handlePrepareWriteRequest -> r.AttributeHandle:  18
>>>> data: 3132333435353637383930313233343535363738393031323334353536373839303132333435353637383930313233343535363738393031323334353536373839303132333435353637383930313233343535363738393031323334353536373
83930, offset: 99, 0xc4200d6d80

>>> handlePrepareWriteRequest -> r.AttributeHandle:  18
>>>> data: 3132333435353637383930313233343535363738393031323334353536373839303132333435353637383930313233343535363738393031323334353536373839303132333435353637383930313233343535363738393031323334353536373
83930, offset: 198, 0xc4200d6d80

>>> handlePrepareWriteRequest -> r.AttributeHandle:  18
>>>> data: 3132333435353637383930313233343535363738393031323334353536373839303132333435353637383930313233343535363738393031323334353536373839303132333435353637383930313233343535363738393031323334353536373
83930, offset: 297, 0xc4200d6d80

>>> handlePrepareWriteRequest -> r.AttributeHandle:  18
>>>> data: 313233343535363738393031323334353536373839303132333435353637383930313233343535363738393031323334353536373839303132333435353637383930, offset: 396, 0xc4200d6d80
2017/10/16 16:59:26 count: Wrote 123455678901234556789012345567890123455678901234556789012345567890123455678901234556789012345567890123455678901234556789012345567890123455678901234556789012345567890123455
678901234556789012345567890123455678901234556789012345567890123455678901234556789012345567890123455678901234556789012345567890123455678901234556789012345567890123455678901234556789012345567890123455678901
234556789012345567890123455678901234556789012345567890123455678901234556789012345567890

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant