2 package org.ocera.orte.tools;
3 import org.ocera.orte.types.*;
6 * Class Conversions provides conversions between IPAddress
7 * and String and between NtpTime and String.
9 * @author Lukas Pokorny (lukas_pokorny@centrum.cz)
10 * @author CTU FEE Prague - Department of Control Engineering (dce.felk.cvut.cz)
11 * @author Project ORTE - OCERA Real Time Ethernet (www.ocera.org)
12 * @author dedication to Kj
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 of the License, or
19 * (at your option) any later version.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
29 public class Conversions {
31 /** load native library 'libjorte.so' */
33 System.loadLibrary("jorte");
40 * IPAddressToString - converts and return IP address from number
41 * notation into its dot notation in string
43 * @param ipAddress source IP address in number notation
44 * @return IP address in string(dot) notation
47 String IPAddressToString(long ipAddress);
51 * StringToIPAddress - converts IP and returns address from dot notation
52 * -string into its number notation
54 * @param ipAddress source IP address in string(dot) notation
55 * @return IP address in number notation
58 long StringToIPAddress(String ipAddress);
62 * NtpTimeToStringMs - converts NtpTime from number notation into its
63 * string notation in miliseconds
65 * @param time time given in JNtpTime object
66 * @return NtpTime in string notation in miliseconds
69 String NtpTimeToStringMs(NtpTime time);
73 * NtpTimeToStringUs - converts NtpTime from number notation into its
74 * string notation in microseconds
76 * @param time time given in JNtpTime object
77 * @return NtpTime in string notation in microseconds
80 String NtpTimeToStringUs(NtpTime time);