kpishere / Net485

A popular network protocol for RS485 / EIA-485 transmission networks in residential HVAC following OSI Layer conventions
GNU General Public License v2.0
25 stars 4 forks source link

How do I build this on Linux (Fedora 31, or Centos 7) #2

Open sipvoip opened 4 years ago

sipvoip commented 4 years ago

I installed swift, but I get an error on "swift build":

[root@marge net485Listen]# swift build error: root manifest not found

So I tried "swift main.swift" and got:

[root@marge net485Listen]# swift main.swift main.swift:10:8: error: no such module 'ORSSerial' import ORSSerial ^ [root@marge net485Listen]# swift Net485.swift Net485.swift:144:30: error: use of undeclared type 'ORSSerialPort' convenience init( port: ORSSerialPort) { ^~~~~ Net485.swift:149:55: error: use of undeclared type 'ORSSerialPort' func serialPortWasRemovedFromSystem( serialPort: ORSSerialPort) { ^~~~~ Net485.swift:153:35: error: use of undeclared type 'ORSSerialPort' func serialPort(_ serialPort: ORSSerialPort, didReceive data: Data) { ^~~~~ Net485.swift:142:35: error: use of undeclared type 'ORSSerialPortDelegate' class PacketProcessor : NSObject, ORSSerialPortDelegate { ^~~~~ Net485.swift:155:49: error: value of type 'Data' has no member 'asHexString' print("\nBytes:(data.count) Pkt:(data.asHexString) (isOK ? "CRCOK":"CRCERR")")


Net485.swift:159:29: error: use of unresolved identifier 'CT485MessageCreator'
            let msgOfType = CT485MessageCreator.shared.create(msg)
                            ^~~~~~~~~~~~~~~~~~~
[root@marge net485Listen]# 
kpishere commented 4 years ago

Looks like you're getting there. The error is about a framework that is missing. In the path Net485/diag/net485Listen/net485Listen/Frameworks/ of this repo, there is a link to another repo for this 'framework' (or library). I'd found it easier to build this other library separately in the past and then have link to the lib. But, if you define your project right, you can build it all in the same project. Not sure how to do that outside of Xcode though. Could have something to do with your manifest file?

Ref: https://swift.org/package-manager/

When u get it working, please share! Looks like I can define one in MacOS too, i'll try that shortly but you may beat me to it.

kpishere commented 4 years ago

@sipvoip I cleaned up the project folders and Xcode workspace (and published that) to be a little more generic. Also gave it a go at a Package.swift file ... but it isn't quite right. What I tried is there, mostly commented out as it conflicts with Xcode project I'm using to build it. Please give that a try and report back if you get it working etc.