claude 生成初步代码

This commit is contained in:
2025-07-06 19:21:42 +08:00
parent 18171d2ea4
commit 1046873661
15 changed files with 1656 additions and 212 deletions

View File

@ -2,31 +2,6 @@
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Build and Development Commands
1. **Build the project**: Run `python build.py` from the root directory.
2. **Clean build artifacts**: Run `python build.py clean`.
3. **Flash the device**: Use the `hfloader` tool with the appropriate firmware file.
## Key Codebase Structure
1. **Entry Point**: `application/ws63/user_main/app_main.c` contains `user_app_main`, the main entry point for the application.
2. **Hilink Integration**:
- `application/samples/wifi/ohos_connect/hilink_adapt/entry/hilink_ble_main.c` is the Hilink SDK configuration and setup entry.
- `application/samples/wifi/ohos_connect/hilink_adapt/product/hilink_device.c` maps physical models to cloud models.
3. **Physical Model Control**:
- GPIO and LED controls are defined in `application/ws63/hsf`.
- Reference implementations are in `refence/LPT26x-HSF-4MB-Hilink_14.2.0.308_20250411`.
4. **Device Configuration**:
- `build/config/target_config/ws63/config.py` contains build configurations.
- `application/samples/wifi/ohos_connect/hilink_adapt/product/device_profile.h` defines device metadata.
## Important Notes
- **Flash Storage**: Device states (switch, LED, etc.) must be saved to flash immediately after modification.
- **Cloud Sync**: Implement logic in `HILINK_NotifyDevStatus` for online/offline state handling.
- **Physical and APP Control**: Ensure synchronization between physical button presses and APP controls.
## Reference Code
- Review `refence/LPT26x-HSF-4MB-Hilink_14.2.0.308_20250411` for examples of Hilink integration and device control.
你是一个资深的物联网嵌入式工程师。这里有一个基于完善的一个智能家居的sdk进行开发的需求其是基于汉枫(hf)模组+鸿蒙系统(ohos)开发的。
## SDK 相关介绍
@ -46,15 +21,14 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
8. indie_upg.md 是关于支持hilink独立升级如何修改代码的说明文档可供参考
通过以上信息你已经可以基本了解整个SDK的运作的原理
目前项目工程是一个已有的项目的代码,你需要在这个基础上进行改造,删除不要的东西。
## 参考已有铲平的代码
这部分非常重要里面有很多的hilink配网和云端交互等的示例可以帮助你更好的编写代码请你仔细分析
refence/LPT26x-HSF-4MB-Hilink_14.2.0.308_20250411
## 参考已有产品的的代码
这部分非常重要里面有很多的hilink配网和云端交互等的示例可以帮助你更好的编写代码
这是此前的一款射灯产品的源码,里面核心的几个文件夹为:
refence/LPT26x-HSF-4MB-Hilink_14.2.0.308_20250411/application/ws63/user_main
refence/LPT26x-HSF-4MB-Hilink_14.2.0.308_20250411/application/samples/wifi/ohos_connect/hilink_adapt/product/
你可以参考看看里面能够复用的部分
application/ws63/user_main
application/samples/wifi/ohos_connect/hilink_adapt/product/
你可以参考看看里面哪些是能够复用的部分。哪些是要删除的
## 软件相关的定义如下:
1. 其物理模型2Q4G.json但是里面的netInfo timer update这几个是hilink内部已经实现无需我们关心我们只需要关心switch3、switch2、switch1、switch4 switch这几个物理模型。
@ -100,13 +74,20 @@ LED 是整个控制面板的背光灯,高电平亮灯(黄色),低电平灭
## 软件编写规范
1. 实现需求需要在application/ws63/user_main另外新建文件夹(命名你根据产品需求定义)实现相关逻辑
2. flush操作的api可见 application/ws63/hsf/hfflash.h 里面定义的 HSF_API 修饰的api
3. gpio其相关api可见 include/driver/pinctrl.h 和 include/driver/gpio.h。
其中 PIN_MODE_0 为输入模式PIN_MODE_1输出模式
GPIO口枚举可见drivers/chips/ws63/include/platform_core_rom.h
5. 延时使用msleep
6. 定时器使用 uapi_timer_xx 头文件定义在-> include/driver/timer.h
7. 线程相关使用 osal_kthread_xx 头文件定义在-> kernel/osal/include/schedule/osal_task.h
### SORONTEK智能面板产测
1.由信标发送产测信号
=》识别固定的热点名作为进入产测的信号
2.开关循环开1-开2-开3-开4-全关-全开-全关
3.每1.5秒执行一个动作
4. 需要校验WIFI 信号强度吗?(射灯有此逻辑)
4. 需要校验WIFI 信号强度吗
### SORONTEK智能面板配网
1. 只有设备处于未绑定状态才能进行配网(出厂或者被APP删除)