I’ve recreated the problem with a simplified solution: UartTestProgram.zip (6.3 KB)
I’m using Visual Studio Code and am selecting the ‘Legato: Generate API stub files’, then select the ‘uart.api’ then select ‘components/uart’ as the output folder. And then the following error is generated:
> Executing task: ifgen --gen-server-stub /home/user/test/interfaces/uart.api --output-dir /home/user/test/components/uart <
Traceback (most recent call last):
File "/home/user/test/leaf-data/SWI-WP77/wp77-legato/bin/ifgen", line 364, in <module>
Main()
File "/home/user/test/leaf-data/SWI-WP77/wp77-legato/bin/ifgen", line 259, in Main
interface = interfaceParser.ParseCode(args.interfaceFile, importDirs, args.namePrefix)
File "/home/user/.leaf/wp77-legato_19.11.2-202005290653/framework/tools/ifgen/interfaceParser.py", line 3049, in ParseCode
iface = parser.apiDocument()
File "/home/user/.leaf/wp77-legato_19.11.2-202005290653/framework/tools/ifgen/interfaceParser.py", line 2639, in apiDocument
self.usetypesStmt()
File "/home/user/.leaf/wp77-legato_19.11.2-202005290653/framework/tools/ifgen/interfaceParser.py", line 2492, in usetypesStmt
self.iface.imports[basename] = ParseCode(fullFilename, self.searchPath)
File "/home/user/.leaf/wp77-legato_19.11.2-202005290653/framework/tools/ifgen/interfaceParser.py", line 3036, in ParseCode
fileStream = ANTLRFileStream(apiPath, 'utf-8')
File "/home/user/.leaf/wp77-legato_19.11.2-202005290653/framework/tools/ifgen/antlr3/streams.py", line 544, in __init__
fp = codecs.open(fileName, 'rb', encoding)
File "/usr/lib/python2.7/codecs.py", line 898, in open
file = __builtin__.open(filename, mode, buffering)
IOError: [Errno 2] No such file or directory: u'le_tty.api'
The terminal process "/bin/bash '-c', 'ifgen --gen-server-stub /home/user/test/interfaces/uart.api --output-dir /home/user/test/components/uart'" terminated with exit code: 1.
Terminal will be reused by tasks, press any key to close it.
I think you misunderstand what it is I’m trying to do. I can use the tty api in my c code no problem. I however wish to make an api where someone can connect to one serial port from different applications/components and give them the option to change (amongst other things) the baudrate. To support this I want to make sure that the .api function uses the correct tty_Speed_t enumeration.
That’s what i was afraid off, I was hoping to be able to reuse the tty_Speed_t enum in my .api file. But I’ll add this to my .api file instead and use that.