'잡동사니'에 해당되는 글 13786건
- 2021.11.20 병원 투어 2주차
- 2021.11.19 nc -k 옵션
- 2021.11.18 wayland / weston
- 2021.11.18 구조체 타입과 변수명은 구분된다?
- 2021.11.17 rpi 3b 2초 부팅 이미지 테스트
- 2021.11.17 wayland weston
- 2021.11.16 라즈베리 피코 USB HID 키코드
- 2021.11.16 라즈베리 파이 피코 한글 키 입력?
- 2021.11.15 병원 투어
- 2021.11.14 오랫만에 키즈카페
nc를 이용해 udp 소켓을 테스트 하고 있는데
UDP 서버(?)
| $ nc -ul 0.0.0.0 6000 |
UDP 클라이언트
| $ nc -u 0.0.0.0 6000 |
로 설정하고 클라이언트에서 1번 메시지를 보낸 후, ctrl-c를 눌러 종료하고
다시 전송하려고 nc -u 옵션을 통해 실행하면 전송되지 않고 종료된다.
혹시나 해서 옵션을 찾아보니 forces nc to stay listening for another connection 이라는게 보이네..
아무튼 udp 커넥션(?)이 이뤄지면 netstat -unl 에서도 사라지는데 멀까...?
| -k' Forces nc to stay listening for another connection after its current connection is completed. It is an error to use this option without the -l option. -l' Used to specify that nc should listen for an incoming connection rather than initiate a connection to a remote host. It is an error to use this option in conjunction with the -p, -s, or -z options. Additionally, any timeouts specified with the -w option are ignored. |
'프로그램 사용 > nc' 카테고리의 다른 글
| nc 엔터 없이 보내기 (0) | 2024.01.17 |
|---|---|
| shell과 nc를 이용하여 주기적으로 데이터 보내기 (0) | 2023.06.23 |
| static const struct android_wlegl_handle_interface server_handle_impl = { add_fd, destroy }; server_wlegl_handle * server_wlegl_handle_create(uint32_t id) { server_wlegl_handle *handle = new server_wlegl_handle; memset(handle, 0, sizeof(*handle)); handle->resource.object.id = id; handle->resource.object.interface = &android_wlegl_handle_interface; handle->resource.object.implementation = (void (**)(void))&server_handle_impl; handle->resource.destroy = server_wlegl_handle_dtor; handle->resource.data = handle; wl_array_init(&handle->ints); wl_array_init(&handle->fds); return handle; } |
| extern const struct wl_interface android_wlegl_handle_interface; |
[링크 : https://github.com/groleo/simple-yuv/blob/master/wayland-android-client-protocol.h]
'프로그램 사용 > wayland' 카테고리의 다른 글
| weston shell (0) | 2021.11.26 |
|---|---|
| weston_log() (0) | 2021.11.25 |
| wayland weston 구조 (0) | 2021.11.24 |
| wayland weston flow (0) | 2021.11.22 |
| wayland weston (0) | 2021.11.17 |
gcc에서 해보는데 헐.. 이게 되네?
변수명과 구조체 타입명은 다른 영역으로 구분되나?
identifier로 동일하게 취급될줄 알았는데 아니라니?
| $ cat t.c #include <stdio.h> struct help { int a; int b; int c;}; struct help a; int help = 1; void main() { a.a = 5; a.b = 7; a.c = 9; printf("%d %d %d %d\n",help, a.a, a.b, a.c); } |
| $ gcc t.c $ ./a.out 1 5 7 9 |
다만, 함수와 변수명의 식별자 영역은 동일한지 에러가 발생한다.
| $ cat t.c #include <stdio.h> void help() { printf("%s\n",__func__); } struct help { int a; int b; int c;}; struct help a; int help = 1; void main() { a.a = 5; a.b = 7; a.c = 9; printf("%d %d %d %d\n",help, a.a, a.b, a.c); help(); } |
| $ gcc t.c t.c:11:5: error: ‘help’ redeclared as different kind of symbol int help = 1; ^~~~ t.c:3:6: note: previous definition of ‘help’ was here void help() ^~~~ t.c: In function ‘main’: t.c:19:2: error: called object ‘help’ is not a function or function pointer help(); ^~~~ t.c:11:5: note: declared here int help = 1; ^~~~ |
'프로그램 사용 > gcc' 카테고리의 다른 글
| gcc / 문자열 선언 (0) | 2022.03.17 |
|---|---|
| static link (0) | 2022.02.07 |
| gcc unsigned to signed upcast 테스트 (0) | 2021.07.08 |
| gcc vectorized loop (0) | 2021.06.30 |
| gcc unsigned to signed cast (0) | 2021.06.22 |
빠르긴 한데
터미널도 없어진건가?!
| $ sudo fdisk /dev/sda -l Disk /dev/sda: 1.9 GiB, 1977614336 bytes, 3862528 sectors Disk model: SD Transcend Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0xdd604128 Device Boot Start End Sectors Size Id Type /dev/sda1 * 1 32768 32768 16M c W95 FAT32 (LBA) /dev/sda2 32769 163840 131072 64M 83 Linux |
| $ ls -al /mnt total 5462 drwxr-xr-x 3 root root 16384 Jan 1 1970 . drwxr-xr-x 21 root root 4096 Aug 20 2020 .. -rwxr-xr-x 1 root root 52296 Nov 16 17:32 bootcode.bin -rwxr-xr-x 1 root root 65 Nov 16 17:32 cmdline.txt -rwxr-xr-x 1 root root 199 Nov 16 17:32 config.txt -rwxr-xr-x 1 root root 2869636 Nov 16 17:32 start.elf drwxr-xr-x 2 root root 2048 Nov 17 2021 'System Volume Information' -rwxr-xr-x 1 root root 2641736 Nov 16 17:32 zImagen $ cat /mnt/config.txt #---> Boot kernel=zImagen disable_overscan=1 boot_delay=0 enable_uart=1 disable_splash=1 #--> OverClock #sdram_freq=700 #initial_turbo=1 #force_turbo=1 #over_voltage=6 #arm_freq=1400 #core_freq=600 $ cat /mnt/cmdline.txt root=/dev/mmcblk0p2 rootwait console=tty1 console=ttyAMA0,115200 |
| /mnt/etc $ cat inittab # /etc/inittab # # Copyright (C) 2001 Erik Andersen <andersen@codepoet.org> # # Note: BusyBox init doesn't support runlevels. The runlevels field is # completely ignored by BusyBox init. If you want runlevels, use # sysvinit. # # Format for each entry: <id>:<runlevels>:<action>:<process> # # id == tty to run on, or empty for /dev/console # runlevels == ignored # action == one of sysinit, respawn, askfirst, wait, and once # process == program to run # Startup the system ::sysinit:/bin/mount -t proc proc /proc ::sysinit:/bin/mount -o remount,rw / ::sysinit:/bin/mkdir -p /dev/pts /dev/shm ::sysinit:/bin/mount -a ::sysinit:/sbin/swapon -a null::sysinit:/bin/ln -sf /proc/self/fd /dev/fd null::sysinit:/bin/ln -sf /proc/self/fd/0 /dev/stdin null::sysinit:/bin/ln -sf /proc/self/fd/1 /dev/stdout null::sysinit:/bin/ln -sf /proc/self/fd/2 /dev/stderr ::sysinit:/bin/hostname -F /etc/hostname # now run any rc scripts ::sysinit:/etc/init.d/rcS # Put a getty on the serial port console::respawn:/sbin/getty -L console 0 vt100 # GENERIC_SERIAL # Stuff to do for the 3-finger salute #::ctrlaltdel:/sbin/reboot # Stuff to do before rebooting ::shutdown:/etc/init.d/rcK ::shutdown:/sbin/swapoff -a ::shutdown:/bin/umount -a -r /mnt/etc/init.d $ ls -al total 9 drwxr-xr-x 2 root root 1024 Nov 16 08:01 . drwxr-xr-x 5 root root 1024 Jan 1 1970 .. -rwxr-xr-x 1 root root 423 Nov 16 08:26 rcK -rwxr-xr-x 1 root root 408 Nov 16 08:26 rcS -rwxr-xr-x 1 root root 1012 Nov 16 08:26 S01syslogd -rwxr-xr-x 1 root root 1004 Nov 16 08:26 S02klogd -rwxr-xr-x 1 root root 1272 Nov 16 08:26 S20urandom -rwxr-xr-x 1 root root 54 Nov 16 08:01 S21ftDev /mnt/etc/init.d $ cat rcS #!/bin/sh # Start all init scripts in /etc/init.d # executing them in numerical order. # for i in /etc/init.d/S??* ;do # Ignore dangling symlinks (if any). [ ! -f "$i" ] && continue case "$i" in *.sh) # Source shell script for speed. ( trap - INT QUIT TSTP set start . $i ) ;; *) # No sh extension, so fork subprocess. $i start ;; esac done pi@raspberrypi:/mnt/etc/init.d $ cat S21ftDev #! /bin/sh /root/QmlTestApplication --platform eglfs /mnt $ sudo ls -al root total 17151 drwx------ 2 root root 1024 Nov 16 08:01 . drwxr-xr-x 19 root root 1024 Jan 1 1970 .. -rwxr-xr-x 1 root root 17710284 Nov 16 08:01 QmlTestApplication /mnt $ sudo file root/QmlTestApplication root/QmlTestApplication: ELF 32-bit LSB executable, ARM, EABI5 version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 4.14.0, stripped |
'embeded > raspberry pi' 카테고리의 다른 글
| rpi 3b 2초 부팅 fs (0) | 2021.11.20 |
|---|---|
| img 파일 마운트 하기 (0) | 2021.11.20 |
| 라즈베리 피코 USB HID 키코드 (0) | 2021.11.16 |
| 라즈베리 파이 피코 한글 키 입력? (0) | 2021.11.16 |
| rpi3 2초만에 부팅하기 (0) | 2021.10.30 |
'프로그램 사용 > wayland' 카테고리의 다른 글
| weston shell (0) | 2021.11.26 |
|---|---|
| weston_log() (0) | 2021.11.25 |
| wayland weston 구조 (0) | 2021.11.24 |
| wayland weston flow (0) | 2021.11.22 |
| wayland / weston (0) | 2021.11.18 |
일단 테스트 해보니.. Keycode.LEFT_ARROW 하니 ctrl+shift+left_arrow 하듯 작동한다.
ascii 문자열로 출력하는 거라 방향키를 넣을 방법은 라이브러리를 수정하기 전에는 불가능 할 듯.
| PRINT_SCREEN = 0x46 """Print Screen (SysRq)""" SCROLL_LOCK = 0x47 """Scroll Lock""" PAUSE = 0x48 """Pause (Break)""" INSERT = 0x49 """Insert""" HOME = 0x4A """Home (often moves to beginning of line)""" PAGE_UP = 0x4B """Go back one page""" DELETE = 0x4C """Delete forward""" END = 0x4D """End (often moves to end of line)""" PAGE_DOWN = 0x4E """Go forward one page""" RIGHT_ARROW = 0x4F """Move the cursor right""" LEFT_ARROW = 0x50 """Move the cursor left""" DOWN_ARROW = 0x51 """Move the cursor down""" UP_ARROW = 0x52 """Move the cursor up""" |
[링크 : https://circuitpython.readthedocs.io/projects/hid/en/latest/_modules/adafruit_hid/keycode.html]
'embeded > raspberry pi' 카테고리의 다른 글
| img 파일 마운트 하기 (0) | 2021.11.20 |
|---|---|
| rpi 3b 2초 부팅 이미지 테스트 (0) | 2021.11.17 |
| 라즈베리 파이 피코 한글 키 입력? (0) | 2021.11.16 |
| rpi3 2초만에 부팅하기 (0) | 2021.10.30 |
| rpi 4는 USB to Ethernet이 아닌가? (0) | 2021.09.29 |
예제 코드를 보다보니 layout 어쩌구 나와서
| from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS |
소스를 뒤져보는데 흐음...
| b"\x04" # a b"\x05" # b b"\x06" # c b"\x07" # d b"\x08" # e |
[링크 : https://github.com/adafruit/Adafruit_CircuitPython_HID/blob/main/adafruit_hid/keyboard_layout_us.py]
걍 한영키 눌러 놓고 아래와 같이 입력하도록 해두니 잘 된다.
"동해물과 백두산이 마르고 딿도록" (딿은 의도적으로 쌍디귿 나오게 하려고 입력한 값)
| keys_pressed = ["ehdgoanfrhk qorentksdl akfmrh Ekfgehfhr"] |
한글 키보드라고 해도.. 키코드는 별개의 문제였구나..
'embeded > raspberry pi' 카테고리의 다른 글
| rpi 3b 2초 부팅 이미지 테스트 (0) | 2021.11.17 |
|---|---|
| 라즈베리 피코 USB HID 키코드 (0) | 2021.11.16 |
| rpi3 2초만에 부팅하기 (0) | 2021.10.30 |
| rpi 4는 USB to Ethernet이 아닌가? (0) | 2021.09.29 |
| rpi zero otg (0) | 2021.09.27 |