Return-Path: From: Ronny L Nilsson To: bluez-devel@lists.sourceforge.net MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="------------Boundary-00=_UHLRDRDJVNHE2W54GQ31" Message-Id: <20050627223919.793D83BC@arbetsmyra.dyndns.org> Subject: [Bluez-devel] bccmd reading clock Sender: bluez-devel-admin@lists.sourceforge.net Errors-To: bluez-devel-admin@lists.sourceforge.net Reply-To: bluez-devel@lists.sourceforge.net List-Unsubscribe: , List-Id: BlueZ development List-Post: List-Help: List-Subscribe: , List-Archive: Date: Tue, 28 Jun 2005 00:37:06 +0200 --------------Boundary-00=_UHLRDRDJVNHE2W54GQ31 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Subject: Hi I was in the need for an enhancement of the bccmd tool and thus made a small change. The supplied patch adds a command for reading the the BT-clock of local device. In the process I also made some minor changes to utils/tools/csr.c to reuse existing code. Besided reading 16-bit variables it can now also read 32- and 8-bits alike. No changes has (yet) been made to hcidump. Should it be done? Regards /Ronny Nilsson --------------Boundary-00=_UHLRDRDJVNHE2W54GQ31 Content-Type: text/x-diff; charset="iso-8859-1"; name="bccmd-clock.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="bccmd-clock.patch" SW5kZXg6IHV0aWxzL3Rvb2xzL2JjY21kLmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQpSQ1MgZmlsZTogL2N2c3Jvb3Qv Ymx1ZXovdXRpbHMvdG9vbHMvYmNjbWQuYyx2CnJldHJpZXZpbmcgcmV2aXNpb24gMS4xCmRpZmYg LXUgLXAgLXIxLjEgYmNjbWQuYwotLS0gdXRpbHMvdG9vbHMvYmNjbWQuYwkxNiBNYXkgMjAwNSAx MTo1MToyNyAtMDAwMAkxLjEKKysrIHV0aWxzL3Rvb2xzL2JjY21kLmMJMjcgSnVuIDIwMDUgMjI6 MzA6MDUgLTAwMDAKQEAgLTc5LDEzICs3OSwzMyBAQCBzdGF0aWMgaW50IGNtZF9rZXlsZW4oaW50 IGRkLCBpbnQgYXJnYywgCiAJcmV0dXJuIDA7CiB9CiAKKworc3RhdGljIGludCBjbWRfY2xvY2so aW50IGRkLCBpbnQgYXJnYywgY2hhciAqYXJndltdKQoreworCXVpbnQzMl90IGNsaz0wOworCWlu dCBlcnI7CisKKwllcnIgPSBjc3JfcmVhZF92YXJpZF91aW50MzIoZGQsIDB4MjE0MywgQ1NSX1ZB UklEX0JUX0NMT0NLLCAmY2xrKTsKKwlpZiAoZXJyIDwgMCkgeworCQllcnJubyA9IC1lcnI7CisJ CXJldHVybiAtMTsKKwl9CisKKwlwcmludGYoIkRldmljZSBsb2NhbCBCVC1jbG9jazogMHgleFxu IiwgY2xrKTsKKworCXJldHVybiAwOworfQorCisKKwogc3RhdGljIHN0cnVjdCB7CiAJY2hhciAq c3RyOwogCWludCAoKmZ1bmMpKGludCBkZCwgaW50IGFyZ2MsIGNoYXIgKiphcmd2KTsKIAljaGFy ICphcmc7CiAJY2hhciAqZG9jOwogfSBjb21tYW5kc1tdID0gewotCXsgImtleWxlbiIsIGNtZF9r ZXlsZW4sICI8aGFuZGxlPiIsICJHZXQgY3VycmVudCBjcnlwdCBrZXkgbGVuZ3RoIiB9LAorCXsg ImtleWxlbiIsIGNtZF9rZXlsZW4sICAgIjxoYW5kbGU+IiwgIkdldCBjdXJyZW50IGNyeXB0IGtl eSBsZW5ndGgiIH0sCisJeyAiY2xvY2siLCBjbWRfY2xvY2ssICAgICAiICAgICAgICAiLCAiR2V0 IGxvY2FsIEJULWNsb2NrIiB9LAogCXsgTlVMTCB9LAogfTsKIApJbmRleDogdXRpbHMvdG9vbHMv Y3NyLmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PQpSQ1MgZmlsZTogL2N2c3Jvb3QvYmx1ZXovdXRpbHMvdG9vbHMvY3Ny LmMsdgpyZXRyaWV2aW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XFudW0sIHVpbnQxNl90IHZhcmlkLCB1aW50OF90ICp2YWx1ZSk7CiBp bnQgY3NyX3JlYWRfcHNrZXlfY29tcGxleChpbnQgZGQsIHVpbnQxNl90IHNlcW51bSwgdWludDE2 X3QgcHNrZXksIHVpbnQ4X3QgKnZhbHVlLCB1aW50MTZfdCBsZW5ndGgpOwogaW50IGNzcl9yZWFk X3Bza2V5X3VpbnQxNihpbnQgZGQsIHVpbnQxNl90IHNlcW51bSwgdWludDE2X3QgcHNrZXksIHVp bnQxNl90ICp2YWx1ZSk7CiBpbnQgY3NyX3dyaXRlX3Bza2V5X3VpbnQxNihpbnQgZGQsIHVpbnQx Nl90IHNlcW51bSwgdWludDE2X3QgcHNrZXksIHVpbnQxNl90IHZhbHVlKTsK --------------Boundary-00=_UHLRDRDJVNHE2W54GQ31-- ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel