shownb / shownb.github.com

shownb.github.io
shownb.github.io
5 stars 1 forks source link

坑二 机械键盘 #54

Open shownb opened 4 years ago

shownb commented 4 years ago

KeyboardMountingStylesCheatSheet

引用自 https://www.showdoc.cc/TuKeyboard?page_id=3846046570596123

选择尺寸

玩家首先根据自身需求选择偏好的键盘尺寸 有20%、40%、60%、80%、100%尺寸 如果您对键盘数字区有依赖,如财务人员,搞20%键盘 如果您偏爱小键盘,对尺寸、便携性有要求,搞40%或60%键盘 如果您偏爱大键盘,搞87%或100%键盘

选择配列

  1. 40%键盘配列 常规配列 92540662ly1gcysg341kvj20io0683ya 普朗克配列 92540662ly1gd0ejhz083j20io068jr5

  2. 60%键盘配列 POKER配列 92540662ly1gczxmszlzvj20ic064we9 64非左移配列 92540662ly1gczqp37y95j20ic064t8h 64左移配列 92540662ly1gd0hkr27g6j20ic064q2p

  3. 80%键盘配列 无门牙配列 92540662ly1gcl4dqbcz4j20mb07na9v 大门牙配列 92540662ly1gclcm9ziagj20mb07na9v 小门牙配列 92540662ly1gcldhho46lj20ma07na9v

pcb 基板 base

卫星轴 stabilizer

有pcb 卫星轴 pcb stabilizer 定位板卫星轴 plate stabilizer

选择轴体 switch

轴体对于一把键盘的手感起基础决定作用; 五脚轴相比三脚轴多两个塑料定位脚,使用五脚轴可以不使用定位板,使用三脚轴必须使用定位板;单一系列轴体包含一套不同颜色轴体,不同颜色轴体代表轴体不同手感,具体手感好坏因人而异; 黑轴 红轴 茶轴 青轴 等等

选择定位板 plate

定位板的作用:防止轴歪; 如果您上一环节中选用五脚轴,轴体本身有防歪功能,定位板可用可不用,手感有别; 如果您上一环节中选用三脚轴,则必须使用定位板;

选择键帽 keycap

键帽材质有abs pbt等 键上面的印刷的工艺有激光 二次升华等。

选择灯珠

我没兴趣

选择工具

烙铁和焊锡丝是装配键盘的必备工具,用于焊接轴体和灯珠; 吸锡器是可选工具,用于解焊轴体和灯珠; 镊子是辅助工具,用于测试PCB及夹持小零件使用; 强烈建议新手选购高品质焊锡丝;

江湖 https://github.com/ktec-hq

资源

shownb commented 4 years ago

BLE基础常用概念

Peripheral 代码显示

广播 ble_advertising

shownb commented 4 years ago

id115 发送消息 0x0AF6

package main

import (
    "fmt"
    "strings"
)

func times(str string, n int) string {
    if n <= 0 {
        return ""
    }
    return strings.Repeat(str, n)
}

func Right(str string, length int, pad string) string {
    return str + times(pad, length-len(str))
}

func padTo(s string, size int) ([]byte, int) {
    message := s
    original_length := len(message)
    if original_length > size {
        original_length = size
    }
    message = Right(message, size, "\x00")
    message = message[0:size]
    return []byte(message), original_length
}

func main() {
    rawMessage := "ok"
    message, message_length := padTo(rawMessage, 22) //Two packets worth of data
    head := message[0:12]
    rest := message[13:22]
    head_length := 0
    rest_length := 0
    if message_length < 13 {
        head_length = message_length
        rest_length = 0
    } else {
        head_length = 12
        rest_length = message_length - 12
    }

    fmt.Println("Sending notification", head, rest, "!", head_length, rest_length)

    fmt.Printf("%x\n",append([]byte{5, 3, 2, 1, 1, byte(message_length), 0, 8},  head...))
    fmt.Printf("%x",append([]byte{5, 3, 2, 2 },  rest...))
}
ID115
settings write on uuid 0x0af6 to device:
responses read on uuid 0x0af7 (notify?)

------
startup - scan:
> 0204
< Value: 0204f2fc581240a6
> Value: 0202
< Value: 02025b0a8f01076d6b050f06

bind:
> Value: 0401f10101010b01 (multiple)
< Value: 040100000000
> Value: 0204
< Value: 0204f2fc581240a6
> Value: 0202
< Value: 02025b0a8f01076d6b050f06
> Value: 063000000000 - (multiple)
< Value: 0630
> Value: 030300803801000c00 (multiple)
< Value: 0303
> Value: 0328aa03000000173b
< Value: 032800
> Value: 032b01
< Value: 032b
> Value: 03295517000700
< Value: 0329
> Value: 030200aa0000000000
< Value: 0302
> Value: 0201
< Value: 020129021b0100560100
> Value: 03110202014e020262f4
ack
> Value: 030201aa0000000000
ack
> Value: 0301e2070205121b1500
ack
> Value: 030202aa0000000000
ack
(af1, af2):
> Value: 08010100
< Value: 0801000000000000
> Value: 030203aa0000000000
ack
> Value: 0803010000
< Value: 08030110e207020500000f602200
< Value: 0803021000000000000000000000000000000000
> Value: 030204aa0000000000
> Value: 0803030f00000000000000000000000000000000
> Value: 0803040f00000000000000000000000000000000
some stuff...
...
(af6, af7):
> Value: 02a0 (multiple)
< Value: 02a00000000000000000000000000000000005

(af1, af2):
> Value: 080200
ack
...

-------

af6: Value: 030300102700000800 - step target 10000, sleep target 8:00
af6: Value: 030300803801000c00 - steps: 80000(0x13880), sleep 12h

[UUID: Unknown (0x0af6)]: Value: 0320090014000f00f500

Value: 0320090014000f00f400 - sedentary alert off
Value: 0320090014000f004100 - sed alert on, 900 am - 800p, sat
Value: 0320090014000f006100 - sed alert on, 900 am - 800p, fri, sat
Value: 0320090014000f00ff00 - "" 7 days
Value: 0320090014000f000100 - "" 0 days
Value: 0320090014000f000000 - "" off
Value: 0320090014000f00ff00 - 7 days, on
Value: 0320090014000f00fe00 - 7days, off

Value: 0201, Value: 020129021b0100590100

after app idle, open up:
> af6: Value: 02a0
< af7: Value: 02a00000000000000000000000000f00000005
> af6: Value: 0201
< af7: Value: 020129021b0100590100

> af6: Value: 0201
< af7: Value: 020129021b0100590100

open camera:
> af6: Value: 060200000000
< af7: Value: 0602

< af7: Value: 070106000000 - cam button press (same each time)
...
> Value: 0201
< Value: 020129021b0100580100
exit camera:
> Value: 060201000000
< Value: 0602

"lift wrist bright screen"
off
> Value: 03285503000000173b
< Value: 032800
on:
> Value: 0328aa03000000173b
< Value: 032800
off:
> Value: 03285503000000173b
on:
> Value: 0328aa03000000173b

in the example, 
0328aa03000000173b format is:
cccceesssshhmmhhmm
cccc = command
ee = enabled (aa: on, 55: off)
ssss = seconds for screen to stay active, LSB (e.g. 0500 = 5 seconds)
hhmm = active times start and stop (where hh and mm are hex value)

language:
> Value: 03110202014e02026242 - follow system
< 0311
> Value: 03110202014e02026200 - english
> Value: 03110202014e01026200 - chinese
> Value: 03110202014e02026242 - follow system

display:
> Value: 032b01 - landscape
< Value: 032b
> Value: 032b02 - vertical

find my phone:
> Value: 0326aa000000 - on
> Value: 032655000000 - off
.. later when find my phone is pressed on watch,
< value: 0702000f

antilost alert?
> Value: 032103 - on ? (multiple tx)
> Value: 032100 - off

dnd:
> Value: 0329aa17000700 - on, start 1100p, finish 0700am
> Value: 03295517000700 - off

------

reboot: (tx: af1, rx: af2)
> af1: Value: 08010100
< af2: Value: 0801000000000000

> Value: 0803010000 - dump something?
< Value: 08030110e207020500000f602200
< Value: 080302100000000000000000000000000f000000
< Value: 0803030f00000000000000000000000000000000
< Value: 0803040f00000000000000000000000000000000
< Value: 0803050f00000000000000000000000000000000
< Value: 0803060f00000000000000000000000000000000
... (continues til 220 ?)
< Value: 0803220f00000000000000000000000000000000 

< Value: 08ee00000000

> Value: 080302 (crc?)
< Value: 08ee00000000
> Value: 080302
< Value: 080302000000
(delay - rebooted?)
> Value: 0804010000
< Value: 0804011000000000000000000002
< Value: 0804021000000000000000000804
< Value: 08ee02000000
> Value: 080402
< Value: 080402000000
> Value: 080200
< Value: 0802

>af6: Value: f001
<af7: Value: f001

------
0201 - get status?

Value: 020129021b0100580100
id115
data synced at 18/02/05, PM 05:18
fw ver: v27 (0x1b)
app v: 2.3.0
remain batt = 88% (0x58)

format: ccccxxxxvvyyggbbzz
cccc: command
xxxx: unknown (2902 is notify uuid, not sure if coincidence?)
vv: fw ver
yy: ?
gg: charge status (01 usb charging)
bb: battery percentage remaining
zz: ?

----
0204 - get bt mac addr

-----
playing around:
> 02a0 (query counters?)
< Value: 02a025000000020000001c0000001100000005
rpt
> Value: 02a025000000020000001c0000001100000005
> Value: 02a025000000020000001c0000001100000005

Value: 02a039000000020000001c0000001a00000005
shaking 10x
Value: 02a025000000020000001c0000001e00000005
shaking 10x
Value: 02a025000000020000001c0000002800000005
(0x28 - 0x1e = 10 dec)

-------
(during pair)
(time/date set):
> af6: Value: 0301e207020512343000
Arrival Time: Feb  5, 2018 18:52:48.165858000 CST
2018 = 0x07e2
18 = 0x12, 52 = 0x34, 48 = 0x30

-------
alarm set:
> Value: 0302015500071eff03 - 1, (every day, 0730am: 0x07 0x1e) on
ack
> Value: 0201
< Value: 020129021b0100560100
> Value: 0302015500071efe03 - 1, off
> Value: 0302015501071efe03 - 1, changed alert type from 1 -> 2
> Value: 0302015501071ed403 - 1, changed to every other day
> Value: 0302015501071ef403
> Value: 0302015501071e8003 - only sunday

> Value: 03020255000809ff03 - 2, 0809am, type 0, enabled, everyday
> Value: 03020255020809bf03 - 2: type 3 (exercise), no saturday
> Value: 03020255020809ef03 - 2: no thurs
> Value: 030202550208097f03 - "" no sun
> Value: 03020255020809fd03 - "" no mon

-------
change units:
> Value: 03110101014e0202629e - metric
> Value: 03110202024e0202629e - imperial

> Value: 03110202024e020262b4 - m -> f

f->m
> Value: 0310bca02800b8070101
> Value: 03110202024e020262fc

m->f
> Value: 03246087a0000000287cf6
> Value: 0310bca02801b8070101
> Value: 03110202024e02026201

> Value: 0310bca02801b8070203 - height cm, weight (kg/100), gender, birthday (yyyy,mm/dd)
> Value: 0310bc102701b8070203 -

> 2106 (repeatedly, dump out diagnostic)

Value: 210655534e3a4646464646464646000000000000
Value: 2106aac007000000000000000000000000000000
Value: 21065571643d302c63713d300000000000000000
Value: 210655736a3d302c676a3d302c64783d31000000

-----------------
activity counters:

steps = 191 (0xbf)
miles = 0.09 = 144.841 m (0x94 = 148m = 0.0919629 mi)
fire = 12 (0x0c)
move time = 2min ? (120 = 0x78)
02a0bf0000000c000000940000007800000005

02a0 bf000000 0c000000 94000000 78000000 05
     steps    fires?   meters   move sec ??

time/date query:
0203 e007 01 01 00 06 38 04     
2016 01 01, 00:07

some queries from 0201-0206

----------------
05xx commands - notification to device
0CMD uu vv aa bb cccccccc...
0501 0001
CMD = 501
uu = 00 buzzer off
uu = 01 buzzer on 
(uu wrong!!)

vv = 00 handset icon center
vv = 01, phone icon left, with text

aa = char pos start
bb = char pos stop
cc... = ascii message

0501010100000000000000000000000000000000
0501 0101 0000 0000 0000 0000 0000 0000 0000 0000
050101010132333435363738 - left tel sym, scrolling numbers (4567...)
050100000132333435363738 - center tel sym
050101010102033435363738 - left tel, sym, (45)
050101010104003435363738 - lef tel sym, (4567)
050101010109003435363738395152535455 - 456789QRS (no scroll)
050102010109003435363738395152535455 - " no diff?
050100010109003435363738395152535455 - ?
050100020109003435363738395152535455 - phone icon center
0501 0001 01 0900 34353637383951525354555600

05010001010f0034353637383951525354555600 - diplay, with buzz
0501 01 01 01 0f 00 34353637383951525354555600 - display, buzzing
0501 00 01 01 0f 00 34353637383951525354555600 - display buzz
0501 00 01 00 0f 00 34353637383951525354555600 - display buzz
0501 00 01 01 05 00 34353637383951525354555600 - display, buzz, 5 chars
0501 00 01 00 05 00 34353637383951525354555600 - 4, 5, 6, 7
0501 00 01 00 05 3334353637383951525354555600

05010201010f0034353637383951525354555600 - nothing
05010100010f0034353637383951525354555600 - no display
05010000010f0034353637383951525354555600 - handset icon, center, buzzing
05010100010f0034353637383951525354555600 - no display ?
0501 00 00 11 0F 353637383951525354555600  - handset icon, center, buzzing
0501 00 01 01 02 03 353637383951525354555600  - left icon, buzz, no text

-----
502 command ??
maybe cancel 0501 notification ?

-------------------
message notification:
0503 00 01 01 00 00 09 313233343536373839
0cmd aa bb cc dd ee ff ggggggggggggggg...
0503 = command
aa = msg id?
bb = msg enable?
cc = msg type (icon?), {1, 3, 4, 6, 7, 8, 9, a, b } (!! DO NOT EXCEED b - will cause reset)
dd = post-string space length for scrolling
ee = startpos
ff = endpos (max: 0xA)
gg... = char string (max 12 chars)

0503 00 01 01 00 00 09 31323334353637383940
0503 00 01 01 00 00 05 33343536373839404142

-----
mysteries:

> 0401 ?
> 0402 ?

> 0101 reboots into some OTA mode