bluerobotics / bluerobotics/ping-python
Add instructions on generating new Ping device type
- Lenguaje dominante
- Python
- Estrellas
- 60
- Forks
- 39
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
There are some users interested in extending Ping-Protocol to support other devices with new messages. I just tested what it would take for a normal user to do that and here are instructions:
Copy message definitions and template from a similar device.
```
cd lib/ping-protocol/src/definitions
cp ping1d.json pinghf.json
cd ../../../../generate
cp ping1d.py.in pinghf.py.in
```
Open `generate-python.py` and add the following to the end:
```
definitionFile = "%s/pinghf.json" % definitionPath
templateFile = "%s/pinghf.py.in" % templatePath
f = open("%s/pinghf.py" % args.output_directory, "w")
f.write(g.generate(definitionFile, templateFile, {"structToken": struct_token}))
f.close()
```
Generate the new files:
```
python3 generate/generate-python.py --output-directory brping
```
Now in `python3` you can `from brping import pinghf`.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Comienza con generate/generate-python.py y los archivos de ejemplo bajo lib/ping-protocol/src/definitions y generate; después, verifica los comandos documentados para copiar ping1d.json y ping1d.py.in y ejecutar el generador. Hecho significa que un usuario normal puede seguir las instrucciones para crear archivos pinghf e importar brping.pinghf en Python.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- documentation
- Tipo de issue
- Documentación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 62/100