Solution
For some cameras, the Serial Number is called a Device ID. In order to read the Device ID, you can implement the following code:
It could also be that you need to modify the attribute entry here. If the above doesn't work for you, try replacing that string with the following: CameraAttributes::DeviceControl::DeviceID