mirror of
				https://github.com/hyperion-project/hyperion.ng.git
				synced 2025-03-01 10:33:28 +00:00 
			
		
		
		
	Added test program for Rs232 device
Former-commit-id: 0d546241456c57117bc6c8535635a938f2ec81fa
This commit is contained in:
		| @@ -48,3 +48,9 @@ target_link_libraries(test_qregexp | ||||
| add_executable(spidev_test spidev_test.c) | ||||
|  | ||||
| add_executable(gpio2spi switchPinCtrl.c) | ||||
|  | ||||
| add_executable(test_rs232highspeed | ||||
| 		TestRs232HighSpeed.cpp | ||||
| 		../libsrc/leddevice/LedRs232Device.cpp) | ||||
| target_link_libraries(test_rs232highspeed | ||||
| 		serialport) | ||||
|   | ||||
							
								
								
									
										32
									
								
								test/TestRs232HighSpeed.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								test/TestRs232HighSpeed.cpp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,32 @@ | ||||
|  | ||||
| // Hyperion includes | ||||
| #include "../libsrc/leddevice/LedRs232Device.h" | ||||
|  | ||||
|  | ||||
| class TestDevice : public LedRs232Device | ||||
| { | ||||
| public: | ||||
| 	TestDevice() : | ||||
| 		LedRs232Device("/dev/ttyAMA0", 2000000) | ||||
| 	{ | ||||
| 		// empty | ||||
| 	} | ||||
|  | ||||
| 	int write(const std::vector<ColorRgb> &ledValues) {} | ||||
| 	int switchOff() {}; | ||||
|  | ||||
| 	void writeTestSequence() | ||||
| 	{ | ||||
| 		uint8_t data = 'T'; | ||||
|  | ||||
| 		writeBytes(1, &data); | ||||
| 	} | ||||
| }; | ||||
|  | ||||
| int main() | ||||
| { | ||||
| 	TestDevice device; | ||||
| 	device.writeTestSequence(); | ||||
|  | ||||
| 	return 0; | ||||
| } | ||||
		Reference in New Issue
	
	Block a user