Repository: incubator-mynewt-newt Updated Branches: refs/heads/develop 01f442104 -> 31a59cf25
MYNEWT-300; newtmgr serial - fix splitting long messages into segments. Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/commit/31a59cf2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/31a59cf2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/31a59cf2 Branch: refs/heads/develop Commit: 31a59cf25f110953074e865b9e77e4e851af26db Parents: 01f4421 Author: Marko Kiiskila <[email protected]> Authored: Tue May 24 10:10:23 2016 -0700 Committer: Marko Kiiskila <[email protected]> Committed: Tue May 24 10:10:23 2016 -0700 ---------------------------------------------------------------------- newtmgr/transport/connserial.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/31a59cf2/newtmgr/transport/connserial.go ---------------------------------------------------------------------- diff --git a/newtmgr/transport/connserial.go b/newtmgr/transport/connserial.go index e9cb9f6..d60468d 100644 --- a/newtmgr/transport/connserial.go +++ b/newtmgr/transport/connserial.go @@ -158,8 +158,9 @@ func (cs *ConnSerial) WritePacket(pkt *Packet) error { cs.writeData([]byte{4, 20}) } - writeLen := util.Min(122, totlen) - writeBytes := base64Data[:writeLen] + writeLen := util.Min(120, totlen - written) + + writeBytes := base64Data[written:written+writeLen] cs.writeData(writeBytes) cs.writeData([]byte{'\n'})
