Learn more about our scanners at: https://joescan.com
Page History
Excerpt | ||
---|---|---|
| ||
How to find scanners on your network. |
Info | ||
---|---|---|
| ||
In general, it is recommended not to we recommend that you do not use the discovery functions in a production application. Instead, it is better to configure your scanners once and store IP addresses and CableIds with your application (e.g., in a settings file or database). For diagnostics and configuration applications, the usage of the discovery functions is fine. |
...
- public static List<DiscoveryResponse> ScannerConfig.FindAllScanners() (Example 1a)
- public static DiscoveryResponse ScannerConfig.FindScanner(int id) (Example 1b)
- public static void ScannerConfig.FindAllScanners(ScannerResponseDelegate srh)
...
- (Example 1c)
Discovering All Scanners – Example 1a
To discover all scanners on a network, use the function in Example 1a above:
Code Block | ||
---|---|---|
| ||
using System.Collections.Generic; using JoeScan.JCamNet; namespace Examples { class Program { static void Main(string[] args) { List<DiscoveryResponse> responses = ScannerConfig.FindAllScanners(); foreach (var discoveryResponse in responses) { System.Console.WriteLine("Base IP Address: {0}, CableId: {1}, Serial Number: {2}", discoveryResponse.BaseIPAddress, discoveryResponse.CableId, discoveryResponse.SerialNumber ); } } } } |
Code Block | ||||
---|---|---|---|---|
| ||||
Base IP Address: 192.168.1.105, CableId: 0, Serial Number: 374 Base IP Address: 192.168.1.150, CableId: 0, Serial Number: 1465 Base IP Address: 192.168.1.105, CableId: 22, Serial Number: 1941 Base IP Address: 192.168.1.105, CableId: 28, Serial Number: 1940 Base IP Address: 192.168.1.105, CableId: 30, Serial Number: 1747 |
Querying for a specific scanner by CableId or Serial Number – Example 1b
If you want to query for a specific scanner, either by it's its CableId or Serial serial number, use the second function above:
...
Code Block | ||
---|---|---|
| ||
Base IP Address: 192.168.1.150, CableId: 0, Serial Number: 1465 |
Finding scanners by using specific criteria – Example 1c
You can also find scanners by using Another possibility to find scanners is to use a delegate method of type ScannerResponseDelegate, which is called for each DiscoveryResponse received fom from the network. This is useful when you have specific criteria to build the list of scanners you want to adress, address (e.g., all scanners on a specific subnet).
Tip |
---|
NoteTip: For proper a more detailed explanation of subnet testing instead of this simplified version, see : http://en.wikipedia.org/wiki/Subnetwork |
...