aprosvetova / xiaomi-kettle

Xiaomi Kettle BLE protocol reverse-engineered
Do What The F*ck You Want To Public License
253 stars 26 forks source link

Export functions and minor style fixes #1

Closed ninedraft closed 5 years ago

ninedraft commented 5 years ago

Thanks for the very useful package!🙌

I'm suggesting slight changes associated with the cycles, perhaps purely stylistic. I also exported functions so that they can be used outside the package!

aprosvetova commented 5 years ago

Hey, this is just a test snippet, don't take it so seriously. And actually, if you really want to use this code (as I do in my Go library), you wouldn't need these functions exported, because your library uses them internally.

Thanks for style fixes, I can merge them if you unexport functions back.

ninedraft commented 5 years ago

you wouldn't need these functions exported, because your library uses them internally.

Could you clarify that point? You offer me not to import your package, but to copy the code from it?

aprosvetova commented 5 years ago

You offer me not to import your package, but to copy the code from it?

@ninedraft, yes, exactly. This repo is not a Go package. This repo is just a protocol description and cipher.go file is a snippet copied from my library with intention to show how cipher functions work in Xiaomi BLE.

Maybe I'll release my library later so you'll just use it like k := kettle.Connect("mac"), k.SetTemperature(), etc.

But now this is just a simple snippet.

ninedraft commented 5 years ago

Ok :(

aprosvetova commented 5 years ago

Ok :(

Hey I'm fine with your style fixes, etc. Let's just keep functions private.

ninedraft commented 5 years ago

Let's just keep functions private. Done

aprosvetova commented 5 years ago

Oh and I forgot that we don't need characteristics.go. All characteristics are listed in protocol description. As I explained, this repo is just a description, no code here. Furthermore, currantlabs/ble will not work with characteristics as numbers.